# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
979997 |
2024-05-11T19:06:25 Z |
TheFuturoma |
Addk (eJOI21_addk) |
C++14 |
|
181 ms |
3280 KB |
#include <cmath>
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <array>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
int n, k;
cin>>n>>k;
vector<ll> arr(n);
vector<ll> prefix(1, 0);
for (int i = 0; i < n; i++) {
cin>>arr[i];
prefix.push_back(prefix.back() + arr[i]);
}
int q;
cin>>q;
for (int test = 0; test < q; test++) {
int t;
cin>>t;
if (t == 1) {
int curr;
cin>>curr;
continue;
}
int left, right, m;
cin>>left>>right>>m;
left--;
right--;
cin>>left>>right>>m;
ll res = 0;
for (int i = left; i <= right - m + 1; i++) {
res += prefix[i + m] - prefix[i];
}
cout << res << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
43 ms |
1992 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
181 ms |
3280 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |