Submission #826938

#TimeUsernameProblemLanguageResultExecution timeMemory
826938t6twotwoPassport (JOI23_passport)C++17
0 / 100
25 ms4308 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector<int> L(N), R(N); for (int i = 0; i < N; i++) { cin >> L[i] >> R[i]; L[i]--, R[i]--; } int Q; cin >> Q; while (Q--) { int X; cin >> X; X--; int ans = 0; for (int f = R[0]; X < N - 1;) { ans++; if (X == f) { ans = -1; break; } for (int i = f - X; i; i--, X++) { f = max(f, R[X]); } } cout << ans << "\n"; } return 6/22; }
#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...