QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#281406#7850. Kernel SchedulerUSP_USP_USP#AC ✓481ms63932kbC++202.2kb2023-12-10 04:04:102023-12-10 04:04:11

Judging History

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

  • [2023-12-10 04:04:11]
  • 评测
  • 测评结果:AC
  • 用时:481ms
  • 内存:63932kb
  • [2023-12-10 04:04:10]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define int long long
#define pb push_back
void dbg_out() { cerr << endl; }
template<typename H, typename... T>
void dbg_out(H h, T... t) { cerr << ' ' << h; dbg_out(t...); }
#define dbg(...) {cerr << #__VA_ARGS__ << ':'; dbg_out(__VA_ARGS__); }

void solve(){
	int n, m; cin >> n >> m;
	vector<set<pair<int, int>>> ge(n);
	vector<set<pair<int, int>>> gs(n);
	for(int i = 0, a, b; i< m; i++){
		cin >> a >> b;
		a--, b--;
		ge[b].insert({a, i});
		gs[a].insert({b, i});
	}
	vector<int> s(n), e(n);
	for(int i = 0; i < n; i++){
		s[i] = gs[i].size();
		e[i] = ge[i].size();
	}
	set<pair<int, int>> pq;
	for(int i = 0; i < n; i++){
		pq.insert({s[i] - e[i], i});
	}
	vector<int> re;
	while(!pq.empty()){
		auto at = *(pq.rbegin());
		pq.erase(at);
		for(auto i : gs[at.second]){ // i.first o nó da saida e i.second o indice da aresta
			re.push_back(i.second); //dependencia que sera aceita
			if(pq.count({s[i.first] - e[i.first], i.first}))
				pq.erase({s[i.first] - e[i.first], i.first}); // apago ele da prioty porque ele mudou o grau 
			ge[i.first].erase({at.second, i.second}); // apago no vertice de chegada (atual, indice da aresta)
			e[i.first] = ge[i.first].size(); // atualizo a quantidade de entrada dele 
			//cout << i.first + 1 << " no saida " << ge[i.first].size() << " " << gs[i.first].size() << "\n";
			pq.insert({s[i.first] - e[i.first], i.first});
		}
		for(auto i : ge[at.second]){ // i.first o nó da saida e i.second o indice da aresta
			if(pq.count({s[i.first] - e[i.first], i.first}))
				pq.erase({s[i.first] - e[i.first], i.first}); // apago ele da prioty porque ele mudou o grau 
			gs[i.first].erase({at.second, i.second}); // apago no vertice de chegada (atual, indice da aresta)
			s[i.first] = gs[i.first].size(); // atualizo a quantidade de saida dele 
			//cout << i.first + 1 << " no entrada " << ge[i.first].size() << " " << gs[i.first].size() << "\n";
			pq.insert({s[i.first] - e[i.first], i.first});
		}
	}
	sort(re.begin(), re.end());
	cout << "YES\n";
	cout << re.size() << "\n";
	for(auto i : re)
		cout << i + 1 << " ";
	cout << "\n";
}

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

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3664kb

input:

3 3
1 2
2 3
3 1

output:

YES
2
1 3 

result:

ok YES

Test #2:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

2 5
1 2
1 2
1 2
2 1
2 1

output:

YES
3
1 2 3 

result:

ok YES

Test #3:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

4 4
1 2
2 3
2 4
3 4

output:

YES
3
2 3 4 

result:

ok YES

Test #4:

score: 0
Accepted
time: 445ms
memory: 59872kb

input:

100000 300000
10485 69762
43149 85819
65377 48594
87608 16329
90645 27092
96559 28215
56560 52797
15265 81505
21616 20187
60187 61531
40748 58408
20842 53022
29032 29110
99906 38862
10498 32090
75988 46051
72985 18604
62188 36029
47868 12473
87013 93163
29484 1602
98718 53416
9097 93823
7980 86814
8...

output:

YES
240822
1 2 3 4 5 6 7 8 9 11 12 13 14 17 18 19 20 21 22 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 43 44 45 46 47 48 49 50 51 52 53 55 56 57 58 59 60 61 62 63 64 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 86 87 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 105 106 109 110 11...

result:

ok YES

Test #5:

score: 0
Accepted
time: 122ms
memory: 42696kb

input:

2 300000
1 2
2 1
1 2
1 2
1 2
1 2
2 1
1 2
1 2
1 2
2 1
2 1
2 1
2 1
1 2
1 2
2 1
1 2
1 2
1 2
2 1
2 1
2 1
1 2
1 2
1 2
1 2
2 1
2 1
2 1
2 1
2 1
1 2
1 2
1 2
1 2
2 1
2 1
1 2
1 2
1 2
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
1 2
1 2
1 2
2 1
2 1
2 1
2 1
1 2
2 1
1 2
1 2
2 1
2 1...

output:

YES
150187
1 3 4 5 6 8 9 10 15 16 18 19 20 24 25 26 27 33 34 35 36 39 40 41 42 44 48 50 56 61 62 63 68 70 71 75 78 83 85 86 87 88 90 91 92 93 94 95 96 97 99 100 101 102 103 106 108 109 110 113 114 115 117 118 119 122 124 126 128 130 131 135 136 137 143 144 145 149 150 151 152 154 156 157 158 160 161...

result:

ok YES

Test #6:

score: 0
Accepted
time: 473ms
memory: 63932kb

input:

100000 300000
18282 6721
2785 37716
79803 99300
82300 6029
10254 36293
9349 33204
78250 71944
45021 38522
85391 97674
84554 17390
29724 19982
33545 48055
30494 98695
53470 39407
68144 98072
43417 31321
61119 25088
17876 45202
17303 87809
29747 92666
66804 30456
85218 93867
30197 30974
64096 66753
81...

output:

YES
279760
1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 21 22 23 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 45 46 47 48 49 50 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 88 89 90 91 93 94 95 96 97 98 99 100 101 103 104 105 106 1...

result:

ok YES

Test #7:

score: 0
Accepted
time: 193ms
memory: 46572kb

input:

2 300000
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1...

output:

YES
300000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1...

result:

ok YES

Test #8:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

2 1
1 2

output:

YES
1
1 

result:

ok YES

Test #9:

score: 0
Accepted
time: 23ms
memory: 20540kb

input:

100000 1
67076 18127

output:

YES
1
1 

result:

ok YES

Test #10:

score: 0
Accepted
time: 393ms
memory: 42968kb

input:

548 299756
211 22
234 21
180 202
467 157
86 457
519 20
418 529
442 333
485 78
269 341
164 187
133 542
22 139
59 14
358 29
307 475
398 490
238 141
448 85
9 54
320 312
357 155
195 148
402 229
273 237
453 421
202 521
241 527
547 256
156 92
183 168
381 78
394 310
531 229
450 117
264 285
344 135
167 118
...

output:

YES
149878
1 2 4 6 8 9 14 15 18 19 21 22 23 24 25 26 29 30 31 32 33 34 35 37 38 39 40 46 49 52 53 54 55 56 58 60 63 64 65 68 70 72 74 75 79 81 83 84 85 88 90 91 92 93 94 96 98 100 102 104 108 109 110 111 115 116 120 125 128 130 132 133 134 135 138 140 143 144 145 153 155 156 157 158 162 163 165 170 ...

result:

ok YES

Test #11:

score: 0
Accepted
time: 1ms
memory: 3580kb

input:

10 90
4 9
5 4
6 10
9 8
7 10
5 8
4 1
5 7
8 6
7 1
8 4
7 2
8 9
1 4
1 3
1 7
9 7
5 3
8 3
3 4
1 8
6 9
10 8
7 4
10 4
7 5
3 6
1 5
10 3
6 7
9 6
9 3
7 6
5 2
6 8
2 9
9 4
10 6
3 5
9 1
7 3
6 2
5 10
2 6
2 7
8 7
10 1
5 9
9 10
3 9
4 10
3 1
3 2
2 1
9 5
6 3
9 2
6 1
1 10
1 2
2 4
8 2
3 7
10 5
7 9
4 7
8 10
2 10
10 9
4 3...

output:

YES
45
2 4 7 9 10 11 12 17 18 19 23 24 25 26 29 31 32 33 34 37 38 40 41 42 46 47 52 53 54 55 56 57 58 62 64 69 70 71 72 80 82 83 84 85 87 

result:

ok YES

Test #12:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

3 6
2 1
1 2
3 1
1 3
3 2
2 3

output:

YES
3
1 3 5 

result:

ok YES

Test #13:

score: 0
Accepted
time: 447ms
memory: 59876kb

input:

100000 300000
20318 83771
8219 53011
5371 93626
46566 3537
21161 21531
52863 48797
94192 24412
29348 51325
1348 27077
51980 94850
90370 78500
79846 46052
75930 26804
6257 30774
32486 7784
11652 87922
875 82042
47117 85196
12679 45853
63629 26851
39396 4489
85088 53309
62358 372
96935 92945
62073 218...

output:

YES
240803
1 3 4 6 7 8 9 10 11 13 14 15 16 18 19 20 21 22 23 24 25 26 27 28 30 31 33 34 36 37 38 39 40 41 42 43 44 45 46 48 49 50 51 52 53 54 55 56 57 59 60 61 62 63 64 65 66 68 69 72 73 75 76 77 78 79 80 81 83 85 86 88 89 90 91 92 93 94 95 96 97 98 100 101 102 104 106 107 108 109 110 111 112 113 11...

result:

ok YES

Test #14:

score: 0
Accepted
time: 480ms
memory: 59936kb

input:

100000 300000
40418 31654
79680 60610
94629 93749
7535 19549
71078 80684
32350 38461
76171 5254
56658 74000
70109 58464
34414 85288
89626 54083
68569 11353
62518 1263
97441 86272
23594 75696
77617 9746
18668 71903
52564 92908
52925 208
92175 16336
91489 51530
9905 84948
55697 37810
95883 40667
61987...

output:

YES
240784
1 2 3 4 5 7 8 9 10 11 12 14 15 16 17 18 19 20 21 24 25 26 27 31 32 34 35 36 38 39 40 41 43 44 45 46 47 48 49 51 52 54 55 56 57 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 100 102 103 104 105 106 107 108 109 110 113 116 ...

result:

ok YES

Test #15:

score: 0
Accepted
time: 472ms
memory: 60100kb

input:

100000 300000
11849 29699
52095 62506
52188 34300
82111 75041
9050 12036
72842 69963
49148 20468
17440 4770
46968 83705
15141 94193
426 7173
46269 22212
27906 37880
13713 58651
42742 55498
82648 57514
74447 13018
21315 81296
77827 55669
50032 45257
66955 36252
29708 88250
19351 29077
26776 32349
574...

output:

YES
240760
1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 28 29 30 31 32 33 36 37 38 40 41 42 43 44 45 46 47 48 51 53 54 55 56 57 58 59 61 62 63 64 65 66 67 68 69 70 71 72 77 79 80 81 83 84 85 86 87 88 90 92 93 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 11...

result:

ok YES

Test #16:

score: 0
Accepted
time: 481ms
memory: 60044kb

input:

100000 300000
59433 48581
5106 77934
5014 84040
81642 23230
40208 76892
3983 17332
1975 65398
9634 47909
76232 76676
76026 29137
32001 2621
92262 86719
78549 75184
65660 20953
80225 25889
31019 70561
61003 97308
49220 56414
41140 39124
13540 65319
2783 64738
86159 72314
23722 28772
26544 4463
86603 ...

output:

YES
240730
1 2 3 5 6 8 9 11 12 14 17 18 19 21 22 25 26 27 29 30 31 32 33 34 35 36 37 39 40 41 42 45 46 47 49 50 51 52 53 54 55 57 58 60 61 62 64 65 66 67 69 70 71 72 73 74 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 97 98 99 100 101 103 104 105 106 108 109 110 111 112 113 114 115 116...

result:

ok YES

Test #17:

score: 0
Accepted
time: 472ms
memory: 59880kb

input:

100000 300000
80405 29813
16217 36416
60512 26459
58101 70684
50497 13293
69843 49925
542 35506
72822 3068
48040 80027
82224 20610
76524 24503
83508 14337
59718 73063
52959 95667
25399 70206
6094 39334
74093 89653
28870 57196
53950 5103
50967 21083
19433 92250
86705 56866
83886 90444
5694 53715
1841...

output:

YES
240886
1 2 3 5 7 8 10 11 12 13 14 15 17 18 20 21 22 23 25 26 27 28 29 31 32 33 34 36 38 40 41 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 67 68 69 70 71 72 73 74 75 76 77 78 79 80 82 83 84 85 86 88 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 107 108 109 110 111 112 113 114...

result:

ok YES

Test #18:

score: 0
Accepted
time: 455ms
memory: 60116kb

input:

100000 300000
20495 40827
79484 67568
86327 84116
70117 36947
97932 38696
68458 78319
38315 63438
59022 83619
24575 84194
80918 73838
39803 86622
48026 59530
48232 12308
30383 22962
44840 56220
11763 29035
53292 1390
43565 35286
87293 9895
58699 46586
730 46944
49726 26690
99475 56234
96237 30113
84...

output:

YES
240704
1 2 3 4 5 6 7 8 9 11 14 15 16 17 18 19 20 21 23 24 25 26 28 29 31 33 34 35 36 38 39 40 42 43 44 48 49 50 51 52 55 56 57 58 59 60 61 63 64 65 66 67 68 69 70 71 72 73 76 77 78 80 81 82 83 84 85 86 87 88 89 90 91 92 93 95 96 97 98 99 100 101 102 105 106 107 108 110 111 113 114 115 116 117 11...

result:

ok YES

Test #19:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

2 2
2 1
1 2

output:

YES
1
1 

result:

ok YES

Test #20:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

3 3
2 1
3 2
1 3

output:

YES
2
1 2 

result:

ok YES

Test #21:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

9 9
6 7
9 3
7 5
8 9
1 6
3 4
5 2
2 8
4 1

output:

YES
8
1 2 3 5 6 7 8 9 

result:

ok YES

Test #22:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

100 100
48 66
8 71
42 17
51 9
91 34
71 58
15 92
94 84
24 6
9 20
80 63
30 99
78 95
27 82
100 1
6 16
40 48
29 8
12 100
32 23
17 37
87 40
66 78
81 72
7 73
85 56
18 62
21 76
73 98
54 91
95 61
68 88
5 52
2 10
41 22
4 41
38 4
86 26
28 70
45 85
65 2
25 51
57 30
67 7
55 5
60 25
44 77
34 14
47 79
59 29
79 94...

output:

YES
99
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 

result:

ok YES

Test #23:

score: 0
Accepted
time: 135ms
memory: 33840kb

input:

100000 100000
95781 73318
78730 59685
79239 41261
89057 7562
48583 99600
91723 41699
83471 91237
59930 64457
19274 1928
66955 62001
47379 68540
55372 67029
30250 56046
14431 99791
13165 79132
9013 73176
97524 2841
73833 89058
80064 58915
1302 87029
37665 43056
34595 99496
84287 27179
94429 66044
638...

output:

YES
99999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...

result:

ok YES

Test #24:

score: 0
Accepted
time: 438ms
memory: 60096kb

input:

100000 300000
73111 14261
57448 73355
30575 69368
7406 54245
50562 37213
83220 29654
77825 14406
25207 73825
37230 54080
77370 40253
32200 66399
86121 24643
66684 10627
11377 96958
50657 64140
91461 61712
19054 31731
88260 13927
32872 26685
49153 96481
45833 33659
9438 23445
74612 42071
318 51736
68...

output:

YES
257128
1 2 3 4 5 7 8 10 12 13 14 15 16 17 18 19 20 21 22 23 25 27 28 29 31 32 33 37 38 39 41 42 43 45 47 48 49 50 51 52 53 54 55 56 57 58 60 63 64 65 66 67 68 69 70 72 73 75 76 77 78 80 81 82 83 85 86 87 88 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 11...

result:

ok YES

Test #25:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

10 100
2 4
7 3
9 10
9 1
7 9
7 1
6 3
6 8
8 1
9 6
7 6
5 4
6 10
3 2
8 6
5 10
3 10
5 10
9 3
5 4
7 3
4 2
7 4
7 4
7 5
8 2
4 2
5 2
7 6
9 6
5 2
6 1
1 3
1 2
1 4
1 2
5 10
6 1
8 2
1 6
9 7
5 7
8 2
8 4
7 6
4 2
6 1
7 10
7 4
6 2
8 2
8 2
5 7
2 3
6 2
1 10
10 3
4 10
9 10
9 4
8 10
9 8
8 2
1 10
8 10
6 3
6 2
5 3
5 4
4 1...

output:

YES
89
2 3 4 5 6 7 8 9 10 11 12 13 16 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 43 44 45 46 47 48 49 50 51 52 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 82 83 84 85 87 88 89 90 91 92 93 94 96 97 98 99 100 

result:

ok YES

Test #26:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

2 100
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 ...

output:

YES
99
1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 

result:

ok YES

Test #27:

score: 0
Accepted
time: 473ms
memory: 59948kb

input:

100000 300000
71951 84998
94082 54685
87985 69035
98780 2958
91406 93156
74507 28932
36309 79557
70529 81994
57918 51086
33800 8195
96079 59998
56533 1852
55606 5469
33942 12589
62562 19119
47819 91038
38736 27766
25687 4430
68474 74586
12323 36221
78726 81138
51739 89171
63365 53350
2922 60754
6797...

output:

YES
257344
1 2 3 4 5 6 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 26 27 28 29 30 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 65 70 71 72 73 74 75 76 77 78 79 80 81 82 84 85 86 87 88 89 92 93 95 96 97 98 99 100 101 102 103 106 107 108 109 110 111 112 ...

result:

ok YES

Test #28:

score: 0
Accepted
time: 404ms
memory: 59896kb

input:

100000 300000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 ...

output:

YES
257713
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

result:

ok YES

Test #29:

score: 0
Accepted
time: 455ms
memory: 59872kb

input:

100000 300000
34838 61420
14402 9459
12478 63893
14016 37790
61743 14483
35651 75953
23182 5853
83938 92385
75521 95119
11358 42133
30759 14950
7005 48689
26046 76108
35361 57128
94037 72623
56747 22570
66047 27332
50445 36663
60860 55024
20726 694
36536 25013
36799 23641
64661 89866
33428 73307
432...

output:

YES
179605
2 4 7 8 11 12 13 15 16 17 20 21 22 24 25 26 27 28 29 32 34 35 37 40 41 42 43 44 45 47 50 51 52 54 55 56 57 58 62 64 65 66 68 69 70 71 72 74 75 76 78 79 81 82 83 85 86 88 89 90 91 94 97 100 103 106 108 109 110 111 112 113 114 117 118 119 121 124 125 126 128 129 130 133 134 135 137 141 142 ...

result:

ok YES

Test #30:

score: 0
Accepted
time: 456ms
memory: 59972kb

input:

100000 299998
74256 30612
32692 95375
3797 17773
15591 80852
63976 44021
49788 89575
11361 41592
69206 19186
62728 66328
19491 31919
58277 40809
75499 5658
61298 20949
81666 76398
16547 98567
66554 15589
96482 1890
76985 40536
7767 69041
65658 36045
77761 29570
56150 87010
20572 14536
22021 45936
67...

output:

YES
204270
1 2 3 5 8 10 12 13 14 15 16 17 18 19 20 21 22 24 25 28 30 31 33 34 35 37 38 41 44 46 48 50 53 55 57 59 61 62 65 66 69 72 73 74 75 79 80 82 83 84 85 88 89 90 91 92 94 95 97 98 100 104 105 106 107 108 109 111 112 113 115 117 119 120 122 123 125 126 131 132 133 134 135 136 138 140 141 142 14...

result:

ok YES

Test #31:

score: 0
Accepted
time: 476ms
memory: 60124kb

input:

100000 299917
38017 35640
37541 13121
51856 64809
53839 89027
32045 71167
76122 45416
8266 41360
99489 79232
99360 61092
48207 44411
69930 35029
45654 71180
17390 91983
64525 41147
28201 95115
68678 22775
92617 60507
6611 53883
6036 29308
51570 43793
69389 15405
68262 75296
90983 63968
50448 69176
1...

output:

YES
206468
1 2 4 5 7 8 10 12 13 14 15 16 17 18 20 21 22 23 24 26 27 28 29 30 31 32 33 34 37 38 39 40 41 42 43 44 46 47 49 50 52 53 55 56 57 59 62 64 66 68 69 71 72 73 74 75 76 77 79 84 88 90 92 94 96 97 98 99 102 103 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 130 133...

result:

ok YES

Test #32:

score: 0
Accepted
time: 466ms
memory: 59864kb

input:

100000 299530
8852 39601
84150 56322
66499 54586
69744 81443
96201 68395
20382 84332
1768 65629
67945 90860
4167 49349
19959 93008
42520 97350
46636 77919
14305 96952
96798 45837
11386 27111
88732 54264
31246 86190
14130 6321
65293 80024
88697 62875
59599 96060
27842 41913
85359 37635
12743 81491
55...

output:

YES
206598
4 5 6 8 10 12 13 14 15 17 18 20 21 23 24 26 27 28 29 30 31 32 33 34 35 38 39 41 42 43 44 45 49 51 52 53 54 55 58 59 60 61 62 65 66 67 69 71 72 74 76 77 78 80 81 83 85 86 90 91 92 93 94 95 96 98 99 100 101 103 104 106 107 108 109 111 113 114 115 117 118 119 121 122 123 124 126 127 128 131 ...

result:

ok YES

Test #33:

score: 0
Accepted
time: 431ms
memory: 56924kb

input:

100000 276072
86701 38196
13180 47722
47439 33251
96905 41837
40035 31523
74756 64011
12898 29712
94896 59019
14573 56588
61160 50273
97009 95261
9593 96152
33831 72875
8081 6472
821 67803
86143 96537
42305 73631
55404 14424
53442 89841
11640 57531
88814 71400
9124 95678
18823 34016
68826 17194
2118...

output:

YES
196030
1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 24 26 27 28 29 30 31 32 35 36 38 39 42 45 46 47 48 51 52 53 54 55 56 59 61 62 64 65 66 67 68 69 70 71 72 73 75 76 77 78 79 82 83 85 86 87 89 90 93 94 95 96 97 98 99 100 101 103 105 106 111 113 117 118 119 120 121 124 125 126 127 129 130 ...

result:

ok YES