QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#316156#8177. Sum is Integerucup-team328#WA 1336ms25740kbC++231.7kb2024-01-27 17:49:262024-01-27 17:49:26

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4
1 6
1 3
1 2
1 2

output:

2

result:

ok "2"

Test #2:

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

input:

5
1 1
2 2
3 3
4 4
5 5

output:

15

result:

ok "15"

Test #3:

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

input:

2
1 99999
99999 100000

output:

0

result:

ok "0"

Test #4:

score: 0
Accepted
time: 262ms
memory: 3980kb

input:

200000
82781 82781
86223 86223
16528 16528
84056 84056
94249 94249
54553 54553
25943 25943
10415 10415
52417 52417
46641 46641
70298 70298
84228 84228
55441 55441
49326 49326
11753 11753
89499 89499
58220 58220
71482 71482
32373 32373
7251 7251
78573 78573
74268 74268
46682 46682
20314 20314
85519 8...

output:

10603308211

result:

ok "10603308211"

Test #5:

score: 0
Accepted
time: 269ms
memory: 4124kb

input:

200000
50741 50741
86798 95775
51104 51104
29372 29372
43295 43295
55065 55065
68947 68947
35282 35282
62467 62467
68481 68481
82613 82613
95921 95921
46302 46302
53806 53806
61244 61244
16078 16078
33476 33476
9084 9084
99273 99273
11678 11678
36816 36816
30311 30311
51479 51479
2667 2667
57043 570...

output:

20066919

result:

ok "20066919"

Test #6:

score: 0
Accepted
time: 341ms
memory: 6140kb

input:

200000
98235 98235
67434 96040
49102 49102
16569 16569
1095 1095
23901 23901
6143 6143
78285 78285
9853 9853
46454 46454
52131 52131
72378 72378
53983 53983
91453 91453
38655 83910
6455 6455
80993 80993
66871 66871
45005 45005
72124 72124
17949 17949
34378 34378
81399 81399
89147 89147
72892 72892
8...

output:

1808373

result:

ok "1808373"

Test #7:

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

input:

200000
64364 74993
65425 91573
10305 10305
31901 31901
90499 95090
13337 47707
32342 38531
75909 93251
95924 95924
12789 12789
77190 77190
82753 99616
33824 79787
48159 48159
32648 32648
90698 98365
89028 89028
36982 36982
11377 11377
79190 88165
23457 23457
24114 24114
55183 71128
65165 65165
4196 ...

output:

593601

result:

ok "593601"

Test #8:

score: 0
Accepted
time: 744ms
memory: 15092kb

input:

200000
42985 42985
30472 30472
4697 50160
91745 95118
77209 77209
32676 32676
96375 96550
18636 18636
93176 93202
27039 27039
2001 85497
74148 94045
82232 92935
71481 80579
99738 99977
90865 90865
93800 99894
11923 64394
29930 29930
40659 40659
12932 24625
47502 47502
34808 52414
37132 37132
78333 8...

output:

200046

result:

ok "200046"

Test #9:

score: 0
Accepted
time: 991ms
memory: 20208kb

input:

200000
38189 83791
82487 82487
42636 69054
46661 46661
55193 83194
40205 87111
29683 29683
79038 79038
98893 99029
1297 1297
29036 29036
14288 14288
92671 94553
93133 96764
20394 27614
51001 51001
95715 99182
57011 64387
40743 84877
53871 53871
9572 36322
52854 52854
48164 48164
54890 90222
13149 23...

output:

66793

result:

ok "66793"

Test #10:

score: 0
Accepted
time: 1301ms
memory: 25440kb

input:

200000
88510 92529
59515 86234
77518 89158
30499 67484
21592 66929
22068 85765
56040 80464
47128 86562
72993 74449
47648 55593
41645 65306
93686 98745
93577 97957
63897 92381
99261 99663
14073 53816
84719 96510
35202 78173
8823 28953
6740 40358
34790 66738
22323 83799
8982 93169
41275 70673
93933 99...

output:

2006

result:

ok "2006"

Test #11:

score: 0
Accepted
time: 1296ms
memory: 25704kb

input:

200000
37542 94781
52292 94781
41475 94781
64295 94781
19942 94781
20632 94781
23926 32922
15988 32922
70400 94781
33866 79612
73489 94781
11346 32922
29597 94781
18851 32922
75353 79612
10468 18421
68719 94781
30040 80989
27637 94781
9313 21313
26684 47093
10860 79612
2343 63521
2159 32922
4106 470...

output:

2

result:

ok "2"

Test #12:

score: 0
Accepted
time: 1291ms
memory: 25740kb

input:

200000
14155 82459
4550 92282
9935 59120
35119 43577
69681 92282
6573 33835
193 59120
2297 88354
33149 59120
21365 59120
14906 59120
4898 71617
802 25637
46411 59120
65015 92282
20057 71617
25342 71617
7440 82459
8525 71617
22625 25637
19203 82459
85531 92282
37402 71617
2660 82459
17454 33835
7833 ...

output:

5

result:

ok "5"

Test #13:

score: 0
Accepted
time: 1103ms
memory: 22024kb

input:

200000
1 2
2 3
4 5
3 7
7 11
6 13
9 17
15 19
17 23
12 29
18 31
10 37
23 41
41 43
20 47
24 53
12 59
14 61
63 67
59 71
16 73
42 79
15 83
18 89
12 97
4 101
91 103
13 107
86 109
3 113
53 127
84 131
112 137
22 139
37 149
58 151
153 157
160 163
156 167
41 173
91 179
66 181
29 191
64 193
107 197
91 199
158 ...

output:

41227

result:

ok "41227"

Test #14:

score: 0
Accepted
time: 1183ms
memory: 22568kb

input:

200000
1 2
1 3
2 5
5 7
5 11
7 13
16 17
6 19
16 23
20 29
23 31
16 37
29 41
2 43
13 47
28 53
3 59
10 61
47 67
1 71
39 73
13 79
56 83
26 89
81 97
11 101
16 103
84 107
17 109
77 113
122 127
4 131
79 137
41 139
146 149
29 151
104 157
64 163
84 167
5 173
25 179
124 181
140 191
45 193
112 197
71 199
166 21...

output:

39056

result:

ok "39056"

Test #15:

score: 0
Accepted
time: 1052ms
memory: 20896kb

input:

200000
1 2
1 3
2 5
5 7
5 11
7 13
16 17
6 19
16 23
20 29
23 31
16 37
29 41
2 43
13 47
28 53
3 59
10 61
47 67
1 71
39 73
13 79
56 83
26 89
81 97
11 101
16 103
84 107
17 109
77 113
122 127
4 131
79 137
41 139
146 149
29 151
104 157
64 163
84 167
5 173
25 179
124 181
140 191
45 193
112 197
71 199
166 21...

output:

59805

result:

ok "59805"

Test #16:

score: 0
Accepted
time: 1001ms
memory: 20132kb

input:

200000
1 2
1 3
2 5
5 7
5 11
7 13
16 17
6 19
16 23
20 29
23 31
16 37
29 41
2 43
13 47
28 53
3 59
10 61
47 67
1 71
39 73
13 79
56 83
26 89
81 97
11 101
16 103
84 107
17 109
77 113
122 127
4 131
79 137
41 139
146 149
29 151
104 157
64 163
84 167
5 173
25 179
124 181
140 191
45 193
112 197
71 199
166 21...

output:

66145

result:

ok "66145"

Test #17:

score: 0
Accepted
time: 825ms
memory: 18932kb

input:

137337
1 2
2 3
4 5
3 7
7 11
6 13
9 17
15 19
17 23
12 29
18 31
10 37
23 41
41 43
20 47
24 53
12 59
14 61
63 67
59 71
16 73
42 79
15 83
18 89
12 97
4 101
91 103
13 107
86 109
3 113
53 127
84 131
112 137
22 139
37 149
58 151
153 157
160 163
156 167
41 173
91 179
66 181
29 191
64 193
107 197
91 199
158 ...

output:

0

result:

ok "0"

Test #18:

score: 0
Accepted
time: 634ms
memory: 16420kb

input:

112633
1 2
2 3
4 5
3 7
7 11
6 13
9 17
15 19
17 23
12 29
18 31
10 37
23 41
41 43
20 47
24 53
12 59
14 61
63 67
59 71
16 73
42 79
15 83
18 89
12 97
4 101
91 103
13 107
86 109
3 113
53 127
84 131
112 137
22 139
37 149
58 151
153 157
160 163
156 167
41 173
91 179
66 181
29 191
64 193
107 197
91 199
158 ...

output:

0

result:

ok "0"

Test #19:

score: 0
Accepted
time: 229ms
memory: 9128kb

input:

48424
1 2
2 3
4 5
3 7
7 11
6 13
9 17
15 19
17 23
12 29
18 31
10 37
23 41
41 43
20 47
24 53
12 59
14 61
63 67
59 71
16 73
42 79
15 83
18 89
12 97
4 101
91 103
13 107
86 109
3 113
53 127
84 131
112 137
22 139
37 149
58 151
153 157
160 163
156 167
41 173
91 179
66 181
29 191
64 193
107 197
91 199
158 2...

output:

0

result:

ok "0"

Test #20:

score: 0
Accepted
time: 1265ms
memory: 24376kb

input:

187753
1 2
1 3
2 5
5 7
5 11
7 13
16 17
6 19
16 23
20 29
23 31
16 37
29 41
2 43
13 47
28 53
3 59
10 61
47 67
1 71
39 73
13 79
56 83
26 89
81 97
11 101
16 103
84 107
17 109
77 113
122 127
4 131
79 137
41 139
146 149
29 151
104 157
64 163
84 167
5 173
25 179
124 181
140 191
45 193
112 197
71 199
166 21...

output:

0

result:

ok "0"

Test #21:

score: 0
Accepted
time: 1113ms
memory: 23088kb

input:

173667
1 2
1 3
2 5
5 7
5 11
7 13
16 17
6 19
16 23
20 29
23 31
16 37
29 41
2 43
13 47
28 53
3 59
10 61
47 67
1 71
39 73
13 79
56 83
26 89
81 97
11 101
16 103
84 107
17 109
77 113
122 127
4 131
79 137
41 139
146 149
29 151
104 157
64 163
84 167
5 173
25 179
124 181
140 191
45 193
112 197
71 199
166 21...

output:

0

result:

ok "0"

Test #22:

score: 0
Accepted
time: 1336ms
memory: 25720kb

input:

200000
1 2
1 3
2 5
5 7
5 11
7 13
16 17
6 19
16 23
20 29
23 31
16 37
29 41
2 43
13 47
28 53
3 59
10 61
47 67
1 71
39 73
13 79
56 83
26 89
81 97
11 101
16 103
84 107
17 109
77 113
122 127
4 131
79 137
41 139
146 149
29 151
104 157
64 163
84 167
5 173
25 179
124 181
140 191
45 193
112 197
71 199
166 21...

output:

0

result:

ok "0"

Test #23:

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

input:

11032
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 ...

output:

32611835

result:

ok "32611835"

Test #24:

score: 0
Accepted
time: 248ms
memory: 3952kb

input:

197164
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 2
1...

output:

7012456789

result:

ok "7012456789"

Test #25:

score: 0
Accepted
time: 192ms
memory: 3956kb

input:

152617
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1...

output:

3698154517

result:

ok "3698154517"

Test #26:

score: 0
Accepted
time: 64ms
memory: 3904kb

input:

51168
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 5
1 ...

output:

140488539

result:

ok "140488539"

Test #27:

score: 0
Accepted
time: 1170ms
memory: 24076kb

input:

193934
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100000
1 100...

output:

8327

result:

ok "8327"

Test #28:

score: 0
Accepted
time: 691ms
memory: 15300kb

input:

143685
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 99999
1 999...

output:

41222

result:

ok "41222"

Test #29:

score: 0
Accepted
time: 878ms
memory: 19244kb

input:

140833
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 99998
1 999...

output:

0

result:

ok "0"

Test #30:

score: 0
Accepted
time: 264ms
memory: 4028kb

input:

200000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000...

output:

10687007638

result:

ok "10687007638"

Test #31:

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

input:

1000
155 1129
42123 42937
53055 56269
84026 89671
36 59
48552 64783
15754 29599
24054 35407
15451 21617
2093 58441
65844 86959
17502 77641
40827 66569
26523 95089
8906 38069
36696 41687
12551 16981
18568 49103
10523 19507
19599 45751
970 7951
6346 61441
5486 12239
80215 87133
11572 43457
42895 48821...

output:

1

result:

ok "1"

Test #32:

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

input:

1072
23184 65839
4268 65843
11075 12487
33343 49757
62837 74717
91526 94693
7014 10459
5497 9371
15993 29741
85921 98669
64910 74197
15087 22229
25783 61381
110 241
32062 36473
16770 28627
17493 23473
15377 15467
509 1619
6541 31957
4299 21377
22010 49411
7335 17231
6477 38201
4617 5869
10432 13147
...

output:

1

result:

ok "1"

Test #33:

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

input:

970
2066 13291
2775 25939
8058 9029
2218 8893
28676 55487
28912 36073
3193 15881
19577 49993
1925 25849
37099 53629
33112 47609
4410 13789
7396 9767
10521 13577
25025 31907
7917 55291
54695 62969
11204 86959
13022 16829
61908 75083
37351 37423
8731 40231
12005 26189
8559 40853
35811 78283
10828 3235...

output:

1

result:

ok "1"

Test #34:

score: 0
Accepted
time: 60ms
memory: 4540kb

input:

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

output:

115097

result:

ok "115097"

Test #35:

score: 0
Accepted
time: 139ms
memory: 4488kb

input:

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

output:

1078095

result:

ok "1078095"

Test #36:

score: 0
Accepted
time: 242ms
memory: 4780kb

input:

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

output:

2570774

result:

ok "2570774"

Test #37:

score: 0
Accepted
time: 62ms
memory: 4776kb

input:

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

output:

107255

result:

ok "107255"

Test #38:

score: 0
Accepted
time: 37ms
memory: 4404kb

input:

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

output:

27575

result:

ok "27575"

Test #39:

score: 0
Accepted
time: 66ms
memory: 4444kb

input:

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

output:

129646

result:

ok "129646"

Test #40:

score: 0
Accepted
time: 94ms
memory: 4484kb

input:

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

output:

355057

result:

ok "355057"

Test #41:

score: -100
Wrong Answer
time: 125ms
memory: 4748kb

input:

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

output:

570274

result:

wrong answer 1st words differ - expected: '570346', found: '570274'