제출 #556063

#제출 시각아이디문제언어결과실행 시간메모리
556063SkurrlAddk (eJOI21_addk)C++17
0 / 100
2066 ms253208 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define N 100005 #define MOD 1000000007 #define endl '\n' #define all(x) x.begin(), x.end() typedef long long int ll; const ll inf = 1e17; void solve() { int n, k; cin >> n >> k; vector<ll> arr(n + 1), pref(n + 1); for (int i = 1; i <= n; ++i) { cin >> arr[i]; pref[i] = pref[i - 1] + arr[i]; cout << pref[i] << " "; } cout << endl; int q; cin >> q; while(q--) { int type; cin >> type; if(type == 1) for(int i = 1; i <= k; ++i) { int smt; cin >> smt; } else { int l, r, m; cin >> l >> r >> m; ll res = 0; for(int i = l; i <= r - m + 1; ++i) { cout << pref[i + m - 1] << " " << pref[i - 1] << " " << m << endl; res += pref[i + m - 1] - pref[i - 1]; } cout << res << endl; } } } int main() { ios_base::sync_with_stdio(0); cin.tie(0); //ll t; cin >> t; //while(t--) solve(); } /* 1 2 3 4 5 6 7 8 9, m = 4 1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7 5 6 7 8 6 7 8 9 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...