library

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

View the Project on GitHub matumoto1234/library

:warning: tools/to-array.hpp

Depends on

Code

#pragma once

#include "./base.hpp"

#include <array>
#include <vector>

namespace matumoto {
  template <typename T, size_t length>
  array<T, length> to_array(const vector<T> &vs) {
    array<T, length> res;
    for (int i = 0; i < (int)length; i++) {
      res[i] = vs[i];
    }
    return res;
  }
} // namespace matumoto
#line 2 "tools/to-array.hpp"

#line 2 "tools/base.hpp"

namespace matumoto {
  using namespace std;
}
#line 4 "tools/to-array.hpp"

#include <array>
#include <vector>

namespace matumoto {
  template <typename T, size_t length>
  array<T, length> to_array(const vector<T> &vs) {
    array<T, length> res;
    for (int i = 0; i < (int)length; i++) {
      res[i] = vs[i];
    }
    return res;
  }
} // namespace matumoto
Back to top page