제출 #1042785

#제출 시각아이디문제언어결과실행 시간메모리
1042785Alexe1900Addk (eJOI21_addk)C++14
0 / 100
187 ms1356 KiB
#include <bits/stdc++.h> using namespace std; signed main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); long long n, k; cin >> n >> k; vector<long long> prefixsums; prefixsums.push_back(0); for (long long i = 0; i < n; i++) { long long a; cin >> a; prefixsums.push_back(a + prefixsums[i]); } long long q; cin >> q; for (long long i = 0; i < q; i++) { long long a; cin >> a; if (a == 1) { for (long long j = 0; j < k; j++) { long long b; cin >> b; } } else { long long l, r, m, s=0; cin >> l >> r >> m; long long it = min(m, (r-l+1)/2); for (long long j = 0; j < it; j++) { s += prefixsums[r] - prefixsums[l-1]; l++; r--; } cout << s << "\n"; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...