Submission #826943

#TimeUsernameProblemLanguageResultExecution timeMemory
826943t6twotwoPassport (JOI23_passport)C++17
6 / 100
30 ms4312 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;) { if (X == f) { ans = -1; break; } ans++; for (int i = f - X; i; i--) { 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...