zawatins-library

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

View the Project on GitHub zawa-tin/zawatins-library

:heavy_check_mark: test/ABC267-C.test.cpp

Depends on

Code

#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/1/ITP1_1_A"

#include "../src/template/accum1d.hpp"

#include <iostream>
#include <vector>
#include <algorithm>

int main() {
	// int N, M; std::cin >> N >> M;
	// std::vector A(N, 0LL);
	// for (long long& a : A) {
	// 	std::cin >> a;
	// }
	// zawa::accum1d sum(A);
	// long long ans = 0;
	// for (int i = 0 ; i < M ; i++) {
	// 	ans += A[i] * (i + 1);
	// }
	// long long now = ans;
	// for (int i = 0 ; i + M < N ; i++) {
	// 	now -= A[i];
	// 	now -= sum.sum(i + 1, i + M);
	// 	now += M * A[i + M];
	// 	ans = std::max(ans, now);
	// }
	// std::cout << ans << std::endl;
	std::cout << "Hello World" << std::endl;
}

/*
 * AtCoder Beginner Contest 267 - C Index x A(Continuous ver.)
 * https://atcoder.jp/contests/abc267/submissions/38149627
 */
#line 1 "test/ABC267-C.test.cpp"
#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/1/ITP1_1_A"

#line 2 "src/template/accum1d.hpp"

#include <vector>
#include <numeric>

namespace zawa {

template <class T>
struct accum1d : std::vector<T> {
	using vector = std::vector<T>;
	accum1d() {
		(*this).push_back(T());
	}
	accum1d(const std::vector<T>& A) {
		(*this).push_back(T());
		std::partial_sum(A.begin(), A.end(), std::back_inserter(*this));
	}	
	template <class InputIterator>
	accum1d(InputIterator begin, InputIterator end) {
		(*this).push_back(T());
		std::partial_sum(begin, end, std::back_inserter(*this));
	}
	T sum(std::size_t l, std::size_t r) {
		return (*this)[r] - (*this)[l];
	}
};

} // namespace zawa
#line 4 "test/ABC267-C.test.cpp"

#include <iostream>
#line 7 "test/ABC267-C.test.cpp"
#include <algorithm>

int main() {
	// int N, M; std::cin >> N >> M;
	// std::vector A(N, 0LL);
	// for (long long& a : A) {
	// 	std::cin >> a;
	// }
	// zawa::accum1d sum(A);
	// long long ans = 0;
	// for (int i = 0 ; i < M ; i++) {
	// 	ans += A[i] * (i + 1);
	// }
	// long long now = ans;
	// for (int i = 0 ; i + M < N ; i++) {
	// 	now -= A[i];
	// 	now -= sum.sum(i + 1, i + M);
	// 	now += M * A[i + M];
	// 	ans = std::max(ans, now);
	// }
	// std::cout << ans << std::endl;
	std::cout << "Hello World" << std::endl;
}

/*
 * AtCoder Beginner Contest 267 - C Index x A(Continuous ver.)
 * https://atcoder.jp/contests/abc267/submissions/38149627
 */
Back to top page