Hedwig's Library

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

View on GitHub

:warning: other_algorithm/index_generator.cpp

Code

#pragma once
#include <bits/stdc++.h>
using namespace std;

// Gridの(i,j)なるインデックスを1次元のインデックスに直す

template <typename T>
struct IndexGenerator {
    T H, W;
    IndexGenerator(T H, T W) : H(H), W(W) {}
    T N() { return H * W; }
    T operator()(T i, T j) { return i * W + j; }
};
#line 2 "other_algorithm/index_generator.cpp"
#include <bits/stdc++.h>
using namespace std;

// Gridの(i,j)なるインデックスを1次元のインデックスに直す

template <typename T>
struct IndexGenerator {
    T H, W;
    IndexGenerator(T H, T W) : H(H), W(W) {}
    T N() { return H * W; }
    T operator()(T i, T j) { return i * W + j; }
};
Back to top page