QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#108801#6392. Curtainscyan17#20 151ms19792kbC++171.9kb2023-05-26 17:46:092024-05-31 13:43:38

Judging History

你现在查看的是最新测评结果

  • [2024-05-31 13:43:38]
  • 评测
  • 测评结果:20
  • 用时:151ms
  • 内存:19792kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-26 17:46:09]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;

#define int long long
#define fr first
#define sc second
#define eb emplace_back
const char nl = '\n';

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");} 
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "LINE(" << __LINE__ << ") -> " <<"[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n, m, q; cin >> n >> m >> q;
    pair<int, int> c[m], p[q];
    for(int i = 0; i < m; ++i) cin >> c[i].fr >> c[i].sc;
    for(int i = 0; i < q; ++i) cin >> p[i].fr >> p[i].sc;

    sort(c, c + m, [&](pair<int, int> left, pair<int, int> right){return left.sc != right.sc ? left.sc < right.sc : left.fr < left.sc;});
    bool dp[n + 1] = {};
    dp[0] = 1;
    int hi = 0;
    for(int i = 0; i < m; ++i) {
        if(hi >= c[i].fr - 1) {
            hi = c[i].sc;
            dp[c[i].sc] = 1;
        }
    }
    for(int i = 0; i < q; ++i) {
        cout << (dp[p[i].sc] ? "YES" : "NO") << nl;
    }
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3676kb

input:

200 200 200
113 134
77 77
110 143
126 157
122 131
161 172
59 134
19 68
117 142
15 103
61 182
12 67
73 97
72 128
68 110
19 137
14 118
60 150
42 64
25 30
118 158
149 164
79 149
21 94
33 82
3 130
36 142
57 170
64 140
40 98
115 132
2 45
27 85
43 181
120 125
82 160
121 176
16 154
59 74
34 52
71 74
57 185...

output:

YES
YES
NO
NO
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
NO
YES
NO
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
YES
NO
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
YES
NO
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
...

result:

wrong answer 1st lines differ - expected: 'NO', found: 'YES'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 20
Accepted

Test #32:

score: 20
Accepted
time: 27ms
memory: 6908kb

input:

100000 100000 100000
44237 85021
45776 80409
39632 94735
28119 63770
47399 73347
28902 87358
27924 65499
23898 54817
50114 96633
11325 37690
46642 94643
9271 47594
47324 47948
27957 58134
20443 88720
20834 89483
77577 94705
7835 30030
37387 59648
8364 76478
66145 76025
12683 79475
1745 33181
43966 5...

output:

YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
NO
YE...

result:

ok 100000 lines

Test #33:

score: 20
Accepted
time: 32ms
memory: 6892kb

input:

100000 100000 100000
35741 60377
60963 75253
19797 42601
35753 79403
7502 18877
47102 89341
28014 35036
2734 26925
1088 30541
8270 68412
10391 85525
50950 55103
57533 94509
52355 77010
77860 88590
8709 31105
4292 21010
438 9944
34758 94378
31011 98475
37243 73734
21568 46633
59934 94265
3839 68210
2...

output:

YES
NO
YES
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
YES
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
N...

result:

ok 100000 lines

Test #34:

score: 20
Accepted
time: 29ms
memory: 6920kb

input:

100000 100000 100000
18975 18982
81626 81634
78338 78345
51904 51907
21622 21626
9459 9461
83080 83081
60411 60421
34363 34365
33780 33783
93124 93133
65357 65367
37292 37297
55530 55536
5618 5622
24035 24043
11654 11659
17731 17738
23791 23801
16233 16236
7398 7400
57194 57202
537 541
70637 70638
1...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #35:

score: 20
Accepted
time: 26ms
memory: 6920kb

input:

100000 100000 100000
56780 56781
78108 78113
38474 38474
71772 71772
46509 46509
31045 31052
39368 39377
8043 8043
34076 34081
29173 29175
74381 74381
97949 97952
76876 76880
47094 47103
89482 89482
21332 21335
51072 51072
21495 21498
44772 44774
29483 29492
15061 15071
98370 98375
7980 7989
44782 4...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #36:

score: 20
Accepted
time: 22ms
memory: 6884kb

input:

100000 100000 100000
13478 13486
66101 66103
29480 29483
67830 67834
44111 44115
74416 74422
18008 18011
23931 23932
34645 34649
69377 69379
18187 18197
7908 7913
27349 27359
75638 75645
47967 47969
10462 10467
7179 7183
90906 90912
17936 17943
29688 29692
91894 91897
38747 38748
85436 85443
52049 5...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #37:

score: 20
Accepted
time: 17ms
memory: 6904kb

input:

100000 100000 100000
35164 35164
35404 35408
44222 44227
73177 73185
64265 64271
80552 80553
23132 23140
29501 29509
36283 36290
54724 54729
39668 39678
95694 95703
35921 35921
94533 94541
26515 26516
49429 49431
79417 79422
37677 37681
8230 8238
56125 56128
87102 87109
66148 66155
16156 16160
59157...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #38:

score: 20
Accepted
time: 147ms
memory: 19776kb

input:

500000 500000 500000
88682 403281
274991 471113
5603 53417
99204 205233
29613 32231
400245 490999
100888 117309
52 4642
11996 165917
214488 475381
264403 381213
65798 375601
5707 203306
31302 110300
347251 490260
338382 376148
191679 232337
111617 135636
140646 479165
86807 475274
244419 453460
1871...

output:

NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
YES
YES
NO
YES
NO
YES
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
...

result:

ok 500000 lines

Test #39:

score: 20
Accepted
time: 145ms
memory: 19720kb

input:

500000 500000 500000
204810 419422
251667 437173
32193 354856
9920 283192
333795 466386
235797 284143
176786 219551
166453 447969
259718 413475
112506 272325
187989 444962
206011 249984
82571 348619
180355 204521
114417 480380
162226 357608
74629 135111
161937 449322
338017 346599
62512 376917
13834...

output:

NO
YES
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
YES
YES
NO
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
YES...

result:

ok 500000 lines

Test #40:

score: 20
Accepted
time: 144ms
memory: 19792kb

input:

500000 500000 500000
390239 390243
392690 392699
75406 75411
37104 37108
159174 159179
202000 202004
37441 37443
67196 67196
142641 142643
362951 362960
113852 113858
425802 425808
356011 356018
238911 238919
10572 10573
326437 326447
446222 446227
76031 76039
228180 228189
393618 393628
476528 4765...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 500000 lines

Test #41:

score: 20
Accepted
time: 140ms
memory: 19720kb

input:

500000 500000 500000
491046 491052
213632 213636
277565 277574
202967 202971
253769 253778
328625 328635
39595 39595
437770 437770
286587 286596
390881 390890
49876 49879
363237 363246
430010 430010
467929 467938
209359 209361
326440 326442
28227 28228
294018 294024
218576 218581
364998 365006
49824...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 500000 lines

Test #42:

score: 20
Accepted
time: 151ms
memory: 19792kb

input:

500000 500000 500000
258441 258443
488078 488082
220685 220686
118795 118804
357929 357934
147861 147867
127676 127677
103011 103019
108726 108727
17921 17923
180414 180415
270589 270591
269265 269273
372633 372633
115213 115216
279441 279446
415635 415642
148242 148250
351887 351891
172449 172452
1...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 500000 lines

Subtask #5:

score: 0
Skipped

Dependency #3:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

0%