Submission #1022723

#TimeUsernameProblemLanguageResultExecution timeMemory
1022723Rolo678Progression (NOI20_progression)C++14
0 / 100
434 ms15444 KiB
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); int n,q; cin >> n >> q; vector<int>a(n+1,0); vector<long long>b(n+1,0); for(int i = 1;i<=n;i++) { cin >> a[i]; b[i] = a[i] -a[i-1]; } int flag = 2; int temp =2; for(int i = 3;i<=n;i++) { cout << b[i] << ' '; if(b[i] !=b[i-1]) { temp =2 ; } else { temp++; flag = max(flag,temp); } } while(q--) { int k; int r,l,s,c; cin >> k; if(k == 1) { cin >> l >> r >> s >> c; } else if (k==2) { cin >> l >> r >> s >> c; flag = n; } else { cin >> l >> r; cout << flag << '\n'; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...