Submission #1072555
Source Code Expand
#define _USE_MATH_DEFINES #include <cmath> #include <string> #include <vector> #include <utility> #include <iostream> #include <algorithm> #include <unordered_map> #include <numeric> #include <array> #include <float.h> #include <memory> #include <functional> #include <iomanip> #include <random> #include <map> using namespace std; constexpr auto DIV = 1000000007ull; using ULL = decltype(0ull); int main() { ULL N, K, output = 0ull; cin >> N >> K; vector<ULL> table(N - K + 1, 0); vector<int> input(N); { ULL index = 0; for (auto&& val : input) { cin >> val; for (ULL i = (index < K ? 0 : index - K + 1); i < table.size(); ++i) { if (i <= index) { table[i] += val; } else { break; } } ++index; } } cout << accumulate(table.begin(), table.end(), 0ull) << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 総和 |
User | hunterkonoha |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 925 Byte |
Status | AC |
Exec Time | 1721 ms |
Memory | 1408 KB |
Judge Result
Set Name | sample | subtask1 | subtask2 | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 50 / 50 | 50 / 50 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample01.txt, sample02.txt |
subtask1 | 00.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample01.txt, sample02.txt |
subtask2 | 00.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, sample01.txt, sample02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00.txt | AC | 3 ms | 256 KB |
01.txt | AC | 3 ms | 256 KB |
02.txt | AC | 3 ms | 256 KB |
03.txt | AC | 3 ms | 256 KB |
04.txt | AC | 3 ms | 256 KB |
05.txt | AC | 3 ms | 256 KB |
06.txt | AC | 3 ms | 256 KB |
07.txt | AC | 3 ms | 256 KB |
08.txt | AC | 3 ms | 256 KB |
09.txt | AC | 3 ms | 256 KB |
10.txt | AC | 3 ms | 256 KB |
11.txt | AC | 40 ms | 1408 KB |
12.txt | AC | 50 ms | 1408 KB |
13.txt | AC | 1721 ms | 1152 KB |
14.txt | AC | 1124 ms | 768 KB |
15.txt | AC | 40 ms | 640 KB |
16.txt | AC | 40 ms | 640 KB |
17.txt | AC | 1721 ms | 1024 KB |
18.txt | AC | 759 ms | 1280 KB |
19.txt | AC | 1645 ms | 896 KB |
sample01.txt | AC | 3 ms | 256 KB |
sample02.txt | AC | 3 ms | 256 KB |