Submission #870679

#TimeUsernameProblemLanguageResultExecution timeMemory
870679Noname_1900Worst Reporter 3 (JOI18_worst_reporter3)C++17
7 / 100
209 ms22840 KiB
#include <bits/stdc++.h> using namespace std; const int NMAX = 500*1000; int distanceNec[NMAX]; int posPersonne[NMAX]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int nbPersonnes, nbRequetes; cin >> nbPersonnes >> nbRequetes; bool tout1 = true; for(int iP = 0; iP < nbPersonnes; iP++) { cin >> distanceNec[iP]; if(distanceNec[iP] != 1) tout1 = false; posPersonne[iP] = -(iP+1); } if(tout1) { int deb = -nbPersonnes; int fin = 0; int a, b; int j; for(int iQ = 0; iQ < nbRequetes; iQ++) { cin >> j >> a >> b; a = max(a, deb+j); b = min(b, fin + j); // cout << a << " " << b << endl; if(a > b) cout << "0" << "\n"; else cout << (b-a+1) << "\n"; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...