QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#42384#857. Social DistancinglarryzhongAC ✓1804ms21100kbC++172.2kb2022-08-02 11:26:262022-08-02 11:26:29

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 3588kb

input:

2
5
1 2
1 3
2 4
2 5
2
1 4
1 5
7
1 2
2 3
2 4
4 6
6 5
6 7
3
1 4 5
3 4 7

output:

YES
10
1 3
4 2
2 4
3 1
1 3
3 1
1 3
4 2
2 5
3 1
NO

result:

ok OK!

Test #2:

score: 0
Accepted
time: 1385ms
memory: 3688kb

input:

100000
18
16 7
18 3
13 8
12 16
17 10
12 4
9 15
2 5
13 6
17 11
12 1
5 6
3 2
17 2
1 2
4 15
14 17
7
1 6 8 15 16 17 18
2 10 11 12 13 14 18
19
3 10
3 5
15 7
9 18
3 9
19 11
11 17
10 4
14 17
7 17
6 9
15 2
12 17
9 8
5 11
9 13
1 13
3 16
9
2 4 5 8 13 16 17 18 19
2 3 4 6 8 13 17 18 19
20
20 14
6 10
3 13
10 4
7...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
21
19 2
11 5
16 13
13 16
5 11
2 19
19 2
4 10
10 4
11 5
5 11
11 5
5 11
4 10
10 4
2 19
19 2
11 5
16 13
13 16
5 11
NO
NO
NO
NO
NO
YES
37
6 18
8 15
14 7
16 19
19 16
7 14
5 4
4 5
15 8
8 15
14 7
7 14
10 2
2 10
18 6
6 18
1 3
3 17
17 3
3 1
18 6
6 18
10 2
2 10
14 7
7 14
15 8
8 ...

result:

ok OK!

Test #3:

score: 0
Accepted
time: 1161ms
memory: 3740kb

input:

1703
165
137 77
32 123
34 74
18 16
79 88
130 10
74 151
112 48
78 91
135 132
145 19
51 19
103 37
13 57
36 157
84 87
48 158
72 161
149 50
89 49
37 8
71 47
85 32
126 35
46 111
119 135
30 53
130 158
123 70
97 109
25 21
16 55
158 118
46 24
77 130
101 23
50 88
13 96
88 22
162 128
125 86
165 106
163 63
75 ...

output:

YES
225
61 98
119 92
30 1
142 41
98 61
61 96
96 133
133 118
118 158
158 48
48 74
74 151
151 155
155 110
110 65
41 122
160 103
103 133
133 118
118 158
158 48
48 74
74 35
35 156
156 62
92 119
119 135
135 8
8 37
37 103
103 133
133 118
118 158
158 48
48 74
74 151
151 155
155 29
1 30
30 53
53 135
135 8
8...

result:

ok OK!

Test #4:

score: 0
Accepted
time: 1643ms
memory: 3768kb

input:

10
2000
1768 1996
1796 195
468 1622
1574 1483
489 1043
257 1318
1288 818
1654 1667
695 1592
974 17
274 1323
116 1169
1052 1404
1568 1163
960 1695
802 950
544 419
595 238
1901 585
888 1527
1861 402
1186 353
1479 1805
373 955
1513 1254
1084 1403
1425 1630
1371 1881
574 1254
1749 806
1784 615
1705 511
...

output:

NO
NO
NO
NO
NO
NO
NO
YES
1859
1915 783
1614 1958
1824 108
136 892
1673 702
1864 386
741 1105
222 1467
1677 1174
882 874
54 591
781 231
1638 1730
1720 559
1755 1385
869 1911
172 1487
801 1610
1480 1859
982 1118
1577 1690
1719 1410
1617 1736
617 925
883 1369
14 514
783 1915
1915 1119
1119 485
485 813
...

result:

ok OK!

Test #5:

score: 0
Accepted
time: 1804ms
memory: 21100kb

input:

10
1989
1562 1958
831 864
1079 73
509 988
920 770
498 1214
877 1208
211 1899
905 98
834 197
1054 1147
748 1041
923 816
1138 1592
129 1250
1091 1455
639 1720
1975 208
625 1692
884 1431
1128 1367
688 2
741 444
1462 1734
68 1133
1309 1666
1769 734
844 1372
275 134
1941 399
1110 1010
715 220
1133 1111
3...

output:

YES
743512
1621 1215
359 1158
700 957
918 1150
385 466
1740 1861
400 87
853 1860
1959 1756
935 1256
1670 949
893 1765
714 67
1458 422
321 891
1245 694
894 662
962 731
249 507
1814 762
616 123
162 46
124 1892
1015 1211
19 686
1145 1593
1450 1322
1383 1105
1181 99
137 1901
1767 203
72 449
12 537
1110 ...

result:

ok OK!

Test #6:

score: 0
Accepted
time: 1071ms
memory: 12052kb

input:

11
1981
1974 1563
23 1887
1820 1714
1134 840
1134 275
571 76
1536 1739
875 821
1857 1114
1110 860
787 1671
1676 1478
1335 480
1885 432
119 438
363 1743
447 96
667 651
1571 816
590 1452
557 1339
185 1119
1643 459
1638 1614
807 266
730 737
404 686
465 1796
202 214
1210 227
1402 1238
744 494
1435 1804
...

output:

YES
180238
330 919
1906 537
869 1629
1185 488
803 1971
1171 823
352 1605
1764 1902
320 319
162 1419
1759 1960
90 1698
1616 1871
184 690
466 1351
64 17
1862 1039
653 193
1418 764
636 1530
960 458
489 1191
814 1084
1555 585
27 1318
966 666
502 1099
790 1549
1926 1733
356 1859
1188 36
873 47
1908 726
1...

result:

ok OK!