kyopro-lib

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

View on GitHub

:warning: Zip function
(Mylib/Misc/zip.cpp)

Operations

Requirements

Notes

Problems

References

Code

#pragma once
#include <algorithm>
#include <tuple>
#include <vector>

namespace haar_lib {
  template <typename... Args>
  auto zip(std::vector<Args>... a) {
    const int N = std::min({a.size()...});
    std::vector<std::tuple<Args...>> ret(N);

    for (int i = 0; i < N; ++i) {
      ret[i] = std::make_tuple(a[i]...);
    }

    return ret;
  }
}  // namespace haar_lib
#line 2 "Mylib/Misc/zip.cpp"
#include <algorithm>
#include <tuple>
#include <vector>

namespace haar_lib {
  template <typename... Args>
  auto zip(std::vector<Args>... a) {
    const int N = std::min({a.size()...});
    std::vector<std::tuple<Args...>> ret(N);

    for (int i = 0; i < N; ++i) {
      ret[i] = std::make_tuple(a[i]...);
    }

    return ret;
  }
}  // namespace haar_lib
Back to top page