e6nlaq/library

This documentation is automatically generated by online-judge-tools/verification-helper

View on GitHub

:warning: include/e6nlaq/internal/csr.hpp

Required by

Code

#pragma once

// This file is a fork of AtCoder Library.

#define E6NLAQ_INTERNAL_CSR_HPP

#include <algorithm>
#include <utility>
#include <vector>

namespace e6nlaq {
namespace internal {

template <class E>
struct csr {
    std::vector<int> start;
    std::vector<E> elist;
    explicit csr(int n, const std::vector<std::pair<int, E>>& edges)
        : start(n + 1), elist(edges.size()) {
        for (auto e : edges) {
            start[e.first + 1]++;
        }
        for (int i = 1; i <= n; i++) {
            start[i] += start[i - 1];
        }
        auto counter = start;
        for (auto e : edges) {
            elist[counter[e.first]++] = e.second;
        }
    }
};

}  // namespace internal

}  // namespace e6nlaq
#line 2 "include/e6nlaq/internal/csr.hpp"

// This file is a fork of AtCoder Library.

#define E6NLAQ_INTERNAL_CSR_HPP

#include <algorithm>
#include <utility>
#include <vector>

namespace e6nlaq {
namespace internal {

template <class E>
struct csr {
    std::vector<int> start;
    std::vector<E> elist;
    explicit csr(int n, const std::vector<std::pair<int, E>>& edges)
        : start(n + 1), elist(edges.size()) {
        for (auto e : edges) {
            start[e.first + 1]++;
        }
        for (int i = 1; i <= n; i++) {
            start[i] += start[i - 1];
        }
        auto counter = start;
        for (auto e : edges) {
            elist[counter[e.first]++] = e.second;
        }
    }
};

}  // namespace internal

}  // namespace e6nlaq
Back to top page