QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#712501#9580. 插排串联icpc_zhzx034#AC ✓21ms14196kbC++141.8kb2024-11-05 15:55:302024-11-05 15:55:30

Judging History

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

  • [2024-11-05 15:55:30]
  • 评测
  • 测评结果:AC
  • 用时:21ms
  • 内存:14196kb
  • [2024-11-05 15:55:30]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define il inline
#define fi first
#define se second
#define mk make_pair
#define eb emplace_back
#define rep(i,l,r) for(int i=(l); i<=(r); ++i)
#define rep_(i,l,r) for(int i=(l); i>=(r); --i)
typedef long long lr;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
constexpr int mod1=998244353,mod2=1e9+7;
constexpr db pi=3.141592653589793,eps=1e-9;
constexpr int inf32=0x3f3f3f3f,Inf32=0xc0c0c0c0;
constexpr lr inf64=0x3f3f3f3f3f3f3f3f,Inf64=0xc0c0c0c0c0c0c0c0;
template<typename T>il T Max(T x,T y) { return (x>y)? x:y; }
template<typename T>il T Min(T x,T y) { return (x<y)? x:y; }
template<typename T>il T gcd(T x,T y) { return (!y)? x:gcd(y,x%y); }
template<typename T>il T Abs(T x) { return (x>0)? x:(-x); }
template<typename T>il T Rnd(T l,T r,mt19937_64 &eng)
{
	uniform_int_distribution<T> uid(l,r);
	return uid(eng);
}
mt19937_64 eng(chrono::high_resolution_clock::now().time_since_epoch().count());
constexpr int N=100100;
int n,x,b[N],d[N];
lr c[N],e[N];
vi v[N];
il void dfs(int u)
{
	if(v[u].empty())
	{
		c[u]=b[u];
		return;
	}
	for(int to:v[u])
		dfs(to),c[u]+=c[to];
}
il void Solve()
{
	cin>>n;
	rep(i,1,n)
		cin>>x>>b[i],v[x].eb(i);
	dfs(0);
	if(c[0]>2200)
	{
		cout<<"NO\n";
		return;
	}
	int m=0;
	rep(i,1,n)
		if(!v[i].empty())
			d[++m]=b[i],e[m]=c[i];
	sort(d+1,d+1+m);
	sort(e+1,e+1+m);
	rep(i,1,m)
		if(d[i]<e[i])
		{
			cout<<"NO\n";
			return;
		}
	cout<<"YES\n";
}
int main()
{
#ifdef LOCAL
	string fpre="test",isuf="in",osuf="out";
	assert(freopen((fpre+"."+isuf).c_str(),"r",stdin));
	assert(freopen((fpre+"."+osuf).c_str(),"w",stdout));
#endif
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int T=1;
	while(T--)
		Solve();
	return 0;
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 7408kb

input:

5
0 500
1 700
1 400
2 100
2 200

output:

YES

result:

ok single line: 'YES'

Test #2:

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

input:

5
0 500
1 700
1 400
2 100
2 300

output:

NO

result:

ok single line: 'NO'

Test #3:

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

input:

4
0 1000
1 800
1 500
2 300

output:

YES

result:

ok single line: 'YES'

Test #4:

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

input:

3
0 1000000000
0 1000000000
0 147483647

output:

NO

result:

ok single line: 'NO'

Test #5:

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

input:

3
0 1000000000
0 1000000000
0 147483648

output:

NO

result:

ok single line: 'NO'

Test #6:

score: 0
Accepted
time: 13ms
memory: 8768kb

input:

64855
0 69748768
0 450926072
1 699448620
3 918617238
4 106189312
1 617660017
5 31691747
2 373080156
0 363984605
0 937885158
10 300431710
8 485372487
1 661592241
1 836709079
13 895424425
1 824052267
9 887752080
15 952380329
0 595041339
14 632034017
18 752444470
4 311747126
2 289503382
11 213029500
23...

output:

NO

result:

ok single line: 'NO'

Test #7:

score: 0
Accepted
time: 11ms
memory: 8248kb

input:

48750
0 3785579
1 2060436
1 1095269
2 3527822
3 2748694
3 452943
5 427867
3 191538
8 2095981
1 3895276
10 3771233
3 3121067
10 416014
9 1443750
1 699351
8 933800
7 361157
16 423718
10 785063
11 2772134
16 3135666
2 1404821
15 417197
12 1560818
4 2709779
13 2489882
24 1070706
23 2364628
22 3451655
8 ...

output:

YES

result:

ok single line: 'YES'

Test #8:

score: 0
Accepted
time: 18ms
memory: 9720kb

input:

84633
0 948740
0 641037
1 718701
2 1491463
4 650546
3 186260
0 1582777
2 3382499
7 422546
7 173919
5 22805
4 2525048
3 55722
13 2477450
4 3136570
0 2480252
8 3021218
5 2229161
6 2865608
19 1079977
17 1435746
4 1313091
12 2415924
23 916623
10 1085785
23 183229
21 2851467
7 3273898
2 1704183
21 108474...

output:

YES

result:

ok single line: 'YES'

Test #9:

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

input:

3085
0 156408
0 605147
0 642324
3 1439620
2 3777153
3 2138026
6 3201634
1 798924
3 3675188
1 738670
10 1065151
4 2642031
3 1039262
4 166483
9 2901954
13 3220176
8 1473831
17 111635
5 1850998
13 2979810
3 2209665
11 1159203
5 1423601
14 1866708
6 190085
20 515853
18 249432
19 3420517
5 880307
16 1633...

output:

YES

result:

ok single line: 'YES'

Test #10:

score: 0
Accepted
time: 8ms
memory: 8848kb

input:

33563
0 3441366
1 127545
1 990142
3 2881275
3 341896
0 1222841
3 3636614
3 1463437
7 1590040
7 1831330
5 718702
10 3734001
8 1638244
12 1896130
10 3378576
5 1467271
5 2093043
15 2417613
14 2357653
9 2048870
1 2888379
10 2675645
8 1497902
2 121692
24 652159
7 3209636
22 3675284
9 1882852
20 2574783
2...

output:

YES

result:

ok single line: 'YES'

Test #11:

score: 0
Accepted
time: 7ms
memory: 8416kb

input:

29579
0 2878456
0 1914553
0 3052352
1 3523343
2 3422684
5 2367471
0 2376896
1 2974820
8 3189629
6 3453774
6 1361998
7 3775154
3 1233399
9 2587463
11 1661485
12 1649552
8 827050
7 1923272
12 2038094
10 3047323
15 3315098
8 1793575
0 1533561
1 3394249
20 409631
2 3082593
2 3216618
17 1508657
0 2224882...

output:

YES

result:

ok single line: 'YES'

Test #12:

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

input:

4257
0 2746453
1 934664
2 1811694
1 1881261
1 828421
2 3823291
4 2495811
5 3492588
8 2811330
4 1868923
9 3158727
0 2588343
0 812790
2 2451335
12 140610
0 2094375
9 1299381
13 3575
16 1013273
9 1885065
6 2846770
4 2248441
22 2918503
0 388423
17 34262
5 1912487
7 3489140
14 1786954
10 468842
10 799647...

output:

YES

result:

ok single line: 'YES'

Test #13:

score: 0
Accepted
time: 3ms
memory: 7604kb

input:

9989
0 37781884
0 106132563
2 234509818
1 39119130
1 713838599
5 889820764
2 38974740
2 359166567
0 67252682
4 376616158
10 625610443
4 919055330
10 5279094
4 235214277
6 583045590
8 799849577
6 879221313
10 638915861
8 856423881
16 791822942
6 91775189
14 414069330
2 702728259
6 782025710
19 456290...

output:

NO

result:

ok single line: 'NO'

Test #14:

score: 0
Accepted
time: 3ms
memory: 7436kb

input:

32007
0 28588942
1 588910732
1 822998678
1 31311276
4 270556381
0 895262877
1 245584694
2 600724483
0 360443315
7 327778173
0 229941301
4 411052996
9 317062555
2 822712314
10 174748461
15 202513163
14 51641000
13 322140013
14 846578787
14 200468205
11 120900618
19 92414230
3 212657879
23 38016953
19...

output:

NO

result:

ok single line: 'NO'

Test #15:

score: 0
Accepted
time: 8ms
memory: 8676kb

input:

62480
0 344484173
1 959220640
1 346311519
3 682971330
0 872962167
5 654054678
1 211950711
3 279636241
1 874351670
2 589327983
2 759732770
4 39012678
1 304520249
13 205761290
9 49505548
2 472723770
8 294877579
8 101446926
0 106436261
9 663722761
12 626129657
7 257345486
19 522538943
17 391435814
22 2...

output:

NO

result:

ok single line: 'NO'

Test #16:

score: 0
Accepted
time: 4ms
memory: 6996kb

input:

15057
0 547431950
1 438631643
1 179667650
3 845345949
3 392421818
4 619759838
3 655010794
4 552746270
5 348211967
8 749755552
8 214419083
5 436972181
7 144606612
10 47659129
7 836963756
8 997710335
5 464546999
10 956455992
9 6490937
12 839906551
10 548394757
2 512718784
17 735705457
21 841989848
3 5...

output:

NO

result:

ok single line: 'NO'

Test #17:

score: 0
Accepted
time: 18ms
memory: 9236kb

input:

79665
0 26601262
1 351073371
0 562669496
1 113861629
0 488720325
3 143645132
2 152367902
2 223288443
1 701505717
5 651806214
0 315664642
5 890947643
6 332686746
8 991291180
11 806170547
1 536624
10 580277712
8 851400609
12 831169455
13 426350055
1 96295828
0 40613494
2 138212373
10 711465091
0 53528...

output:

NO

result:

ok single line: 'NO'

Test #18:

score: 0
Accepted
time: 7ms
memory: 8808kb

input:

54465
0 622736731
1 420881358
0 410079334
0 919962271
3 640215698
5 876473905
6 551273644
3 762238835
2 209117994
7 840764274
3 170436503
4 55241632
10 527700919
0 298040566
3 572894095
7 496841254
1 774443487
1 760496188
17 95740952
11 816157971
17 651436270
9 611917010
1 356463954
5 933438
22 2506...

output:

NO

result:

ok single line: 'NO'

Test #19:

score: 0
Accepted
time: 17ms
memory: 9056kb

input:

81711
0 282604662
1 947414489
2 921146841
3 275753907
2 421291646
4 714882857
1 415741693
5 440078624
7 51188033
6 475790320
6 208861039
0 129590461
3 136073895
0 84000148
9 962967221
8 9984299
13 801017811
9 827504075
3 525642572
17 853670683
6 144426274
17 245662201
18 791510290
22 43729178
21 382...

output:

NO

result:

ok single line: 'NO'

Test #20:

score: 0
Accepted
time: 19ms
memory: 9912kb

input:

96384
0 638462063
0 932608620
2 106211095
1 411417864
1 102796102
2 308927943
3 274807824
1 881458892
4 590352291
1 942231453
10 790716863
5 74008267
1 529155326
0 670276831
14 776970473
12 521913382
12 154429959
11 351006589
18 801507747
16 799119494
9 178502115
6 712119667
21 610240217
20 86211900...

output:

NO

result:

ok single line: 'NO'

Test #21:

score: 0
Accepted
time: 18ms
memory: 9328kb

input:

88157
0 521696562
1 571911131
1 500294151
3 541557733
2 122797269
5 30062326
3 488414871
0 62695298
2 974096972
4 34910748
3 458253569
0 4448449
9 824555997
5 1137692
0 46166453
10 816075570
5 53938845
0 17831235
15 776612881
19 637474003
10 538818723
7 589940160
9 109597025
8 879598110
10 583872754...

output:

NO

result:

ok single line: 'NO'

Test #22:

score: 0
Accepted
time: 14ms
memory: 9056kb

input:

86463
0 772657728
0 457367394
2 782823785
0 827081806
0 491193885
4 934172213
0 467521287
7 700005049
8 365825625
7 67729553
8 926143356
2 406015284
11 296314083
0 148561677
13 643876057
1 195769150
12 132245858
15 317641983
18 100214983
14 339940318
12 48571712
9 406835152
9 743988693
18 127792964
...

output:

NO

result:

ok single line: 'NO'

Test #23:

score: 0
Accepted
time: 2ms
memory: 7656kb

input:

6153
0 627308529
1 80177490
1 499455943
1 123888319
0 749943105
2 4153132
6 322192789
4 555406930
7 666123545
5 626111562
1 943285967
4 166408480
9 276658989
9 31650069
2 15959645
4 704639761
10 544389564
14 294936722
14 308217464
0 45514459
5 624533570
20 150925578
22 185894976
23 631570196
20 7100...

output:

NO

result:

ok single line: 'NO'

Test #24:

score: 0
Accepted
time: 2ms
memory: 7580kb

input:

1
0 1

output:

YES

result:

ok single line: 'YES'

Test #25:

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

input:

1
0 1000000000

output:

NO

result:

ok single line: 'NO'

Test #26:

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

input:

3
0 2201
1 2200
0 1

output:

NO

result:

ok single line: 'NO'

Test #27:

score: 0
Accepted
time: 19ms
memory: 9916kb

input:

100000
0 815121916
1 31761433
1 11466871
3 658667824
4 511405192
5 501074199
0 680433292
1 584582554
3 642414314
7 135133204
1 67246919
7 447116205
7 948645336
9 326944894
9 828613990
0 896924406
3 388591370
11 511735628
18 570192075
3 540319410
7 172783987
21 43180012
11 773245452
19 110917204
1 12...

output:

NO

result:

ok single line: 'NO'

Test #28:

score: 0
Accepted
time: 14ms
memory: 9644kb

input:

100000
0 952441803
1 417874927
2 538969462
2 292052813
4 755275238
0 984088455
0 457379982
4 873148501
8 181471857
5 558039453
2 620380282
4 26893900
2 614858046
0 635100016
10 844792387
10 262264362
2 919955049
16 178644882
0 744473295
16 158680105
0 555127677
20 55344820
6 731496151
23 541000860
1...

output:

NO

result:

ok single line: 'NO'

Test #29:

score: 0
Accepted
time: 20ms
memory: 9984kb

input:

100000
0 384728982
0 140424908
2 361439344
2 515372386
4 704177992
2 688441074
2 570763162
7 161714447
3 384092911
7 54574629
3 804917425
1 311704304
1 281070757
5 311851357
6 860970785
4 996200538
11 746286018
12 919183065
15 213721806
18 555702436
6 642504074
13 772542338
15 279681434
18 266051807...

output:

NO

result:

ok single line: 'NO'

Test #30:

score: 0
Accepted
time: 21ms
memory: 9644kb

input:

100000
0 522048869
0 157942182
0 257538154
1 148757376
3 243015330
5 466422620
5 347709852
2 523909322
7 218117745
5 477480878
1 358050786
11 891482000
1 947283468
0 620006479
9 877149182
15 361540493
9 277649695
13 881059611
17 461631954
15 952724768
16 656251544
12 784707146
22 237932134
14 696135...

output:

NO

result:

ok single line: 'NO'

Test #31:

score: 0
Accepted
time: 19ms
memory: 9948kb

input:

100000
0 954336048
0 880492165
1 785040744
0 77109657
4 486885376
1 539371459
5 461093031
5 812475269
2 420738799
1 974016054
2 911184149
8 544888624
9 949932667
5 633194309
5 893327579
9 390443961
10 103980665
0 916565085
0 635913174
13 276118171
1 743627941
11 796871954
9 491150125
9 421186410
19 ...

output:

NO

result:

ok single line: 'NO'

Test #32:

score: 0
Accepted
time: 13ms
memory: 14196kb

input:

100000
0 57
1 17
2 77
3 30
4 81
5 99
6 35
7 61
8 84
9 34
10 23
11 47
12 49
13 91
14 32
15 37
16 77
17 52
18 59
19 92
20 21
21 13
22 44
23 61
24 43
25 77
26 37
27 23
28 22
29 85
30 79
31 44
32 39
33 41
34 65
35 78
36 81
37 76
38 14
39 35
40 95
41 22
42 71
43 93
44 29
45 52
46 33
47 85
48 80
49 15
50 ...

output:

YES

result:

ok single line: 'YES'

Test #33:

score: 0
Accepted
time: 10ms
memory: 14148kb

input:

100000
0 42
1 94
2 78
3 69
4 76
5 100
6 38
7 72
8 69
9 52
10 79
11 60
12 72
13 91
14 60
15 62
16 33
17 42
18 78
19 72
20 20
21 42
22 48
23 34
24 35
25 69
26 25
27 51
28 64
29 25
30 82
31 94
32 13
33 43
34 73
35 89
36 28
37 58
38 92
39 12
40 46
41 79
42 30
43 94
44 80
45 90
46 83
47 31
48 65
49 56
50...

output:

YES

result:

ok single line: 'YES'

Test #34:

score: 0
Accepted
time: 14ms
memory: 14104kb

input:

100000
0 18
1 63
2 89
3 73
4 54
5 60
6 100
7 11
8 78
9 60
10 92
11 24
12 96
13 51
14 92
15 55
16 84
17 97
18 51
19 81
20 77
21 76
22 40
23 20
24 23
25 30
26 27
27 62
28 66
29 75
30 83
31 68
32 92
33 21
34 91
35 35
36 77
37 59
38 19
39 52
40 31
41 41
42 17
43 26
44 60
45 67
46 10
47 56
48 65
49 76
50...

output:

NO

result:

ok single line: 'NO'

Test #35:

score: 0
Accepted
time: 7ms
memory: 14136kb

input:

100000
0 45
1 35
2 86
3 40
4 91
5 48
6 70
7 56
8 85
9 66
10 92
11 40
12 79
13 66
14 82
15 40
16 29
17 57
18 68
19 11
20 78
21 27
22 91
23 49
24 66
25 51
26 12
27 15
28 83
29 57
30 41
31 29
32 14
33 76
34 90
35 83
36 54
37 100
38 95
39 47
40 52
41 72
42 33
43 94
44 39
45 90
46 86
47 27
48 19
49 21
50...

output:

NO

result:

ok single line: 'NO'

Test #36:

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

input:

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

output:

YES

result:

ok single line: 'YES'

Test #37:

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

input:

200
0 10
0 8
0 3
0 9
0 5
0 3
0 5
0 9
0 1
0 8
0 1
0 10
0 9
0 3
0 7
0 2
0 1
0 5
0 3
0 8
0 1
0 4
0 7
0 6
0 4
0 3
0 5
0 7
0 7
0 8
0 4
0 4
0 6
0 4
0 9
0 3
0 8
0 4
0 1
0 2
0 7
0 8
0 8
0 6
0 5
0 8
0 10
0 3
0 7
0 4
0 7
0 8
0 7
0 10
0 7
0 8
0 10
0 3
0 2
0 4
0 5
0 9
0 5
0 4
0 1
0 4
0 9
0 10
0 4
0 1
0 3
0 6
0 ...

output:

YES

result:

ok single line: 'YES'

Test #38:

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

input:

400
0 9
0 1
0 5
0 10
0 6
0 2
0 1
0 4
0 5
0 7
0 2
0 10
0 3
0 1
0 3
0 9
0 9
0 10
0 6
0 9
0 9
0 1
0 9
0 8
0 10
0 1
0 9
0 6
0 3
0 4
0 2
0 6
0 1
0 5
0 8
0 7
0 4
0 5
0 4
0 10
0 10
0 4
0 5
0 5
0 4
0 1
0 4
0 4
0 3
0 10
0 10
0 6
0 2
0 8
0 9
0 8
0 6
0 9
0 5
0 7
0 7
0 9
0 4
0 1
0 5
0 10
0 7
0 10
0 2
0 8
0 4
0 ...

output:

YES

result:

ok single line: 'YES'

Test #39:

score: 0
Accepted
time: 8ms
memory: 8092kb

input:

100000
0 4
0 9
0 6
0 3
0 5
0 7
0 7
0 3
0 8
0 9
0 5
0 4
0 10
0 8
0 9
0 4
0 7
0 3
0 2
0 8
0 1
0 2
0 6
0 8
0 6
0 5
0 1
0 7
0 5
0 4
0 7
0 8
0 6
0 9
0 6
0 6
0 4
0 3
0 4
0 8
0 2
0 1
0 4
0 6
0 4
0 8
0 8
0 4
0 7
0 8
0 8
0 10
0 5
0 1
0 5
0 2
0 2
0 5
0 8
0 6
0 2
0 10
0 7
0 10
0 10
0 1
0 6
0 1
0 10
0 8
0 2
0 6...

output:

NO

result:

ok single line: 'NO'

Test #40:

score: 0
Accepted
time: 2ms
memory: 7440kb

input:

2
0 2200
1 2200

output:

YES

result:

ok single line: 'YES'

Test #41:

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

input:

122
0 30
1 13
0 22
3 6
0 49
5 55
0 2
7 6
0 10
9 63
0 41
11 1
0 32
13 1
0 3
15 47
0 87
17 87
0 29
19 81
0 157
21 34
0 1
23 29
0 66
25 29
0 49
27 58
0 77
29 80
0 81
31 58
0 115
33 32
0 2
35 49
0 63
37 66
0 58
39 115
0 10
41 35
0 32
43 34
0 1
45 11
0 29
47 32
0 17
49 147
0 35
51 77
0 6
53 76
0 58
55 6
...

output:

YES

result:

ok single line: 'YES'

Test #42:

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

input:

216
0 17
1 30
0 13
3 2
0 10
5 1
0 63
7 4
0 14
9 2
0 9
11 17
0 11
13 13
0 1
15 4
0 31
17 34
0 25
19 38
0 6
21 25
0 46
23 5
0 51
25 3
0 15
27 1
0 16
29 33
0 2
31 15
0 9
33 19
0 39
35 5
0 1
37 20
0 45
39 4
0 21
41 27
0 4
43 35
0 25
45 7
0 2
47 55
0 8
49 8
0 54
51 1
0 11
53 11
0 11
55 18
0 30
57 8
0 2
5...

output:

YES

result:

ok single line: 'YES'

Test #43:

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

input:

12
0 443
1 24
0 820
3 443
0 24
5 516
0 234
7 234
0 164
9 164
0 516
11 820

output:

NO

result:

ok single line: 'NO'

Test #44:

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

input:

86
0 103
1 53
0 43
3 141
0 29
5 64
0 9
7 43
0 4
9 231
0 40
11 4
0 64
13 2
0 19
15 26
0 118
17 149
0 53
19 1
0 1
21 29
0 2
23 91
0 53
25 53
0 33
27 21
0 26
29 1
0 50
31 33
0 7
33 118
0 36
35 50
0 74
37 79
0 4
39 2
0 108
41 29
0 39
43 138
0 28
45 108
0 141
47 80
0 80
49 9
0 49
51 19
0 83
53 9
0 9
55 3...

output:

NO

result:

ok single line: 'NO'

Test #45:

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

input:

1708
0 2
1 2
0 1
3 2
0 3
5 1
0 3
7 1
0 1
9 1
0 5
11 1
0 4
13 1
0 1
15 2
0 1
17 3
0 1
19 3
0 4
21 4
0 4
23 3
0 1
25 2
0 1
27 1
0 5
29 4
0 2
31 10
0 4
33 2
0 2
35 1
0 2
37 1
0 1
39 1
0 2
41 2
0 8
43 3
0 1
45 2
0 3
47 5
0 2
49 2
0 2
51 1
0 1
53 5
0 2
55 1
0 1
57 4
0 1
59 1
0 4
61 2
0 1
63 4
0 1
65 1
0 ...

output:

NO

result:

ok single line: 'NO'

Test #46:

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

input:

6
0 1004
1 1005
0 1127
3 68
0 68
5 1127

output:

NO

result:

ok single line: 'NO'

Test #47:

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

input:

82
0 155
1 55
0 19
3 51
0 18
5 18
0 40
7 59
0 79
9 19
0 4
11 96
0 43
13 97
0 59
15 25
0 111
17 53
0 8
19 27
0 86
21 55
0 60
23 39
0 21
25 12
0 55
27 43
0 97
29 1
0 60
31 60
0 10
33 111
0 111
35 4
0 1
37 155
0 39
39 135
0 55
41 61
0 27
43 60
0 20
45 93
0 19
47 111
0 61
49 134
0 53
51 47
0 96
53 21
0 ...

output:

NO

result:

ok single line: 'NO'

Test #48:

score: 0
Accepted
time: 2ms
memory: 7984kb

input:

1252
0 2
1 3
0 6
3 1
0 2
5 3
0 2
7 3
0 6
9 2
0 2
11 4
0 6
13 4
0 1
15 3
0 2
17 2
0 4
19 4
0 6
21 2
0 10
23 1
0 2
25 8
0 5
27 3
0 2
29 7
0 1
31 4
0 4
33 10
0 4
35 7
0 1
37 6
0 3
39 2
0 3
41 4
0 5
43 6
0 1
45 9
0 2
47 1
0 1
49 3
0 2
51 3
0 13
53 3
0 2
55 3
0 1
57 1
0 2
59 2
0 1
61 5
0 1
63 1
0 3
65 4
...

output:

NO

result:

ok single line: 'NO'

Test #49:

score: 0
Accepted
time: 7ms
memory: 8244kb

input:

70759
0 3018
0 9681
0 41944
0 29070
0 176379
0 101867
0 86717
0 22740
0 29693
0 8898
0 9540
0 43643
0 38813
0 14653
0 88467
0 185349
0 65057
0 57907
0 68927
0 42062
0 144343
0 14318
0 6197
0 4708
0 113650
0 33939
0 265
0 52518
0 62613
0 63003
0 2198
0 17917
0 2172
0 58584
0 52725
0 125859
0 126765
0...

output:

NO

result:

ok single line: 'NO'

Test #50:

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

input:

8643
0 599108
0 949256
0 221583
0 181879
0 489821
0 432139
0 216711
0 77846
0 193295
0 497724
0 1932479
0 85258
0 531296
0 1170575
0 394455
0 1334299
0 990273
0 526590
0 283449
0 310111
0 258090
0 123021
0 195129
0 1163049
0 525488
0 730631
0 64906
0 6071
0 313994
0 301400
0 100803
0 1035571
0 51312...

output:

NO

result:

ok single line: 'NO'

Extra Test:

score: 0
Extra Test Passed