Submission #372264

#TimeUsernameProblemLanguageResultExecution timeMemory
372264gustasonAirplanes (LMIO17_lektuvai)C++11
0 / 100
1 ms384 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<int> a(n); for(int i = 0; i < n; i++) { cin >> a[i]; } vector<int> p(n); for(int i = 0; i < n-1; i++) { cin >> p[i]; } int q; cin >> q; for(int i = 0; i < q; i++) { char type; cin >> type; if (type == 'I') { int idx; cin >> idx; cout << a[idx-1] << "\n"; } else if (type == 'P') { int idx, by; cin >> idx >> by; a[idx-1] += by; if (idx != n) { a[idx] = max(a[idx], a[idx-1]); } } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...