#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<ll,ll>
#define pb push_back
#define fi first
#define se second
const ll N = 5e5+3;
ll n,m,q,a,b;
ll l[N],r[N],s[N],e[N];
ll tmp[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m >> q;
for(int i=1; i<=m; i++) {
cin >> l[i] >> r[i];
}
while(q--) {
cin >> a >> b;
for(int i=1; i<=n; i++) tmp[i] = false;
for(int i=1; i<=m; i++) {
if(l[i] >= a && r[i] <= b) {
for(int j=l[i]; j<=r[i]; j++) {
tmp[j] = true;
}
}
}
bool ans = true;
for(int i=a; i<=b; i++) {
if(!tmp[i]) {
cout << "NO" << endl;
ans = false;
break;
}
}
if(ans) cout << "YES" << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
2 ms |
4444 KB |
Output is correct |
4 |
Correct |
2 ms |
4440 KB |
Output is correct |
5 |
Correct |
2 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
2 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
11 |
Correct |
2 ms |
4440 KB |
Output is correct |
12 |
Correct |
2 ms |
4444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
2 ms |
4444 KB |
Output is correct |
4 |
Correct |
2 ms |
4440 KB |
Output is correct |
5 |
Correct |
2 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
2 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
11 |
Correct |
2 ms |
4440 KB |
Output is correct |
12 |
Correct |
2 ms |
4444 KB |
Output is correct |
13 |
Correct |
113 ms |
4600 KB |
Output is correct |
14 |
Correct |
109 ms |
4600 KB |
Output is correct |
15 |
Correct |
103 ms |
4444 KB |
Output is correct |
16 |
Correct |
121 ms |
4440 KB |
Output is correct |
17 |
Correct |
224 ms |
4444 KB |
Output is correct |
18 |
Correct |
31 ms |
4440 KB |
Output is correct |
19 |
Correct |
31 ms |
4440 KB |
Output is correct |
20 |
Correct |
17 ms |
4444 KB |
Output is correct |
21 |
Correct |
29 ms |
4700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
2 ms |
4444 KB |
Output is correct |
4 |
Correct |
2 ms |
4440 KB |
Output is correct |
5 |
Correct |
2 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
2 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
11 |
Correct |
2 ms |
4440 KB |
Output is correct |
12 |
Correct |
2 ms |
4444 KB |
Output is correct |
13 |
Correct |
113 ms |
4600 KB |
Output is correct |
14 |
Correct |
109 ms |
4600 KB |
Output is correct |
15 |
Correct |
103 ms |
4444 KB |
Output is correct |
16 |
Correct |
121 ms |
4440 KB |
Output is correct |
17 |
Correct |
224 ms |
4444 KB |
Output is correct |
18 |
Correct |
31 ms |
4440 KB |
Output is correct |
19 |
Correct |
31 ms |
4440 KB |
Output is correct |
20 |
Correct |
17 ms |
4444 KB |
Output is correct |
21 |
Correct |
29 ms |
4700 KB |
Output is correct |
22 |
Execution timed out |
1561 ms |
5424 KB |
Time limit exceeded |
23 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
2 ms |
4444 KB |
Output is correct |
3 |
Correct |
2 ms |
4596 KB |
Output is correct |
4 |
Correct |
1 ms |
4440 KB |
Output is correct |
5 |
Correct |
232 ms |
4596 KB |
Output is correct |
6 |
Correct |
31 ms |
4444 KB |
Output is correct |
7 |
Correct |
31 ms |
4444 KB |
Output is correct |
8 |
Execution timed out |
1541 ms |
4932 KB |
Time limit exceeded |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
2 ms |
4444 KB |
Output is correct |
4 |
Correct |
2 ms |
4440 KB |
Output is correct |
5 |
Correct |
2 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
2 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
11 |
Correct |
2 ms |
4440 KB |
Output is correct |
12 |
Correct |
2 ms |
4444 KB |
Output is correct |
13 |
Correct |
113 ms |
4600 KB |
Output is correct |
14 |
Correct |
109 ms |
4600 KB |
Output is correct |
15 |
Correct |
103 ms |
4444 KB |
Output is correct |
16 |
Correct |
121 ms |
4440 KB |
Output is correct |
17 |
Correct |
224 ms |
4444 KB |
Output is correct |
18 |
Correct |
31 ms |
4440 KB |
Output is correct |
19 |
Correct |
31 ms |
4440 KB |
Output is correct |
20 |
Correct |
17 ms |
4444 KB |
Output is correct |
21 |
Correct |
29 ms |
4700 KB |
Output is correct |
22 |
Execution timed out |
1597 ms |
7768 KB |
Time limit exceeded |
23 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4444 KB |
Output is correct |
2 |
Correct |
1 ms |
4440 KB |
Output is correct |
3 |
Correct |
2 ms |
4444 KB |
Output is correct |
4 |
Correct |
2 ms |
4440 KB |
Output is correct |
5 |
Correct |
2 ms |
4444 KB |
Output is correct |
6 |
Correct |
1 ms |
4444 KB |
Output is correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
2 ms |
4444 KB |
Output is correct |
9 |
Correct |
1 ms |
4444 KB |
Output is correct |
10 |
Correct |
1 ms |
4440 KB |
Output is correct |
11 |
Correct |
2 ms |
4440 KB |
Output is correct |
12 |
Correct |
2 ms |
4444 KB |
Output is correct |
13 |
Correct |
113 ms |
4600 KB |
Output is correct |
14 |
Correct |
109 ms |
4600 KB |
Output is correct |
15 |
Correct |
103 ms |
4444 KB |
Output is correct |
16 |
Correct |
121 ms |
4440 KB |
Output is correct |
17 |
Correct |
224 ms |
4444 KB |
Output is correct |
18 |
Correct |
31 ms |
4440 KB |
Output is correct |
19 |
Correct |
31 ms |
4440 KB |
Output is correct |
20 |
Correct |
17 ms |
4444 KB |
Output is correct |
21 |
Correct |
29 ms |
4700 KB |
Output is correct |
22 |
Execution timed out |
1561 ms |
5424 KB |
Time limit exceeded |
23 |
Halted |
0 ms |
0 KB |
- |