algo

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub kuhaku-space/algo

:heavy_check_mark: test/aoj/joi/prefix_sum.test.cpp

Depends on

Code

// competitive-verifier: PROBLEM https://onlinejudge.u-aizu.ac.jp/problems/0516
#include "algorithm/prefix_sum.hpp"
#include <iostream>
#include <limits>
#include <vector>

int main(void) {
    while (true) {
        int n, k;
        std::cin >> n >> k;
        if (!n) break;
        std::vector<int> a(n);
        for (auto &e : a) std::cin >> e;
        prefix_sum<int> ps(a);
        int ans = std::numeric_limits<int>::lowest();
        for (int i = 0; i < n - k + 1; ++i) ans = std::max(ans, ps.sum(i, i + k));
        std::cout << ans << '\n';
    }

    return 0;
}
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/resolver.py", line 291, in resolve
    bundled_code = language.bundle(path, basedir=basedir)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 242, in bundle
    bundler.update(path)
  File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 479, in update
    self._resolve(pathlib.Path(included), included_from=path)
  File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 286, in _resolve
    raise BundleErrorAt(path, -1, "no such header")
competitive_verifier.oj.verify.languages.cplusplus_bundle.BundleErrorAt: algorithm/prefix_sum.hpp: line -1: no such header

Test cases

Env Name Status Elapsed Memory
g++ judge_data :heavy_check_mark: AC 21 ms 4 MB
Back to top page