Submission #254000

#TimeUsernameProblemLanguageResultExecution timeMemory
254000test2Monkey and Apple-trees (IZhO12_apple)C++14
0 / 100
2074 ms4216 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 7 ; int t, a, b, c; int rip[N] ; int main() { ios_base::sync_with_stdio(0); cin.tie(0); //freopen("in.in", "r", stdin); cin >> t; int C = 0 ; while (t--) { int a, b, c; cin >> a >> b >> c; b+= C ; c+= C ; if(a == 1){ int ans = 0; for(int j = b ; j<= c ;j++){ ans+= rip[j] ; } C = ans ; cout<< ans <<"\n" ; }else{ for(int j = b ;j<= c;j ++){ rip[j] = 1 ; } } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...