QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#140096#1144. Dungeons Gamelittlecat#24 2846ms47424kbC++141.3kb2023-08-15 05:47:352024-07-04 01:42:33

Judging History

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

  • [2024-07-04 01:42:33]
  • 评测
  • 测评结果:24
  • 用时:2846ms
  • 内存:47424kb
  • [2023-08-15 05:47:35]
  • 提交

answer

#include <vector>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
#define mx 400001

int n; ll s[mx], p[mx]; int w[mx], l[mx];
bool task3 = 1;
int a[mx][25]; ll b[mx][25], c[mx], d[mx][25];

void init(int N, vi S, vi P, vi W, vi L)
{
    n = N;
    for (int i = 0; i < n; i++) s[i] = S[i], p[i] = P[i], w[i] = W[i], l[i] = L[i];
    for (int i = 1; i < n; i++) if (s[i] != s[0]) task3 = 0;
    if (task3)
    {
        //follow lose-cycle, binary lift
        //a = final location, b = gain, d = min needed to escape
        for (int i = 0; i < n; i++) a[i][0] = l[i], b[i][0] = p[i], d[i][0] = s[i];
        a[n][0] = n;
        for (int t = 1; t < 25; t++) for (int i = 0; i <= n; i++)
            a[i][t] = a[a[i][t-1]][t-1], b[i][t] = b[i][t-1]+b[a[i][t-1]][t-1],
            d[i][t] = min(d[i][t-1],d[a[i][t-1]][t-1]-b[i][t-1]);
        //c = gain from i to n
        for (int i = n-1; i >= 0; i--) c[i] = c[w[i]] + s[i];
    }
}
ll simulate(int x, int z)
{
    if (task3)
    {
        for (int t = 24; t >= 0; t--) if (z < d[x][t]) z += b[x][t], x = a[x][t];
        if (z < s[x]) z += s[x], x = w[x];
        return z + c[x];
    }
    while (x != n)
    {
        if (z >= s[x]) z += s[x], x = w[x];
        else z += p[x], x = l[x];
    }
    return z;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 3ms
memory: 16084kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
1 73
9829
6
1
0
0 2
0 7
0 2
0 2
0 6
0 2
0 6
0 2
0 7
0 7
0 10
0 1
0 9
0 5
0 5
0 7
0 5
0 9
0 3
0 8
0 9
0 8
0 6
0 4
0 1
0 9
0 8
0 10
0 10
0 1
0 8
0 8
0 8
0 7
0 3
0 10
0 4
0 2
0 9
0 4
0 1
0 3
0 6
0 10
0 10
0 10
0 1
0 1
0 10
0 1
0 5
0 9
0 2
0 6
0 8
0 9
0 6
0 6
0 6
0 2...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
19659
19658
19659
19659
19663
19659
19663
19659
19658
19658
19661
19658
19660
19662
19662
19658
19662
19660
19660
19659
19660
19659
19663
19661
19658
19660
19659
19661
19661
19658
19659
19659
19659
19658
19660
19661
19661
19659
19660
19661
19658
19660
19663
19...

result:

ok 75 lines

Test #2:

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

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
10 86
1820 5250 4629 1552 6552 3205 7668 2419 6343 9299
8841 5649 9910 9479 9718 2612 7483 2360 7862 1567
8 8 9 5 6 9 8 8 9 10
4 6 4 1 4 6 8 7 4 7
4 7
3 10
4 5
2 10
2 4
0 10
3 4
3 1
0 6
0 4
5 8
9 4
4 5
5 10
7 6
6 5
1 10
8 10
6 1
4 4
9 1
8 7
6 4
5 2
5 3
4 1
5 2
5 ...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
39587
30381
39585
39782
39776
38713
30375
30372
38709
38707
25745
21992
39585
25747
22787
23130
28784
37734
23126
39584
21989
37731
23129
25739
25740
39581
25739
25743
23132
37730
22784
39775
23135
21994
30373
30377
25738
25740
39773
39775
22784
39581
21993
39...

result:

ok 88 lines

Test #3:

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

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
2000 100
6 5 4 7 6 7 8 2 10 8 3 10 1 2 8 6 5 7 6 9 10 9 9 6 5 7 2 9 3 6 1 8 7 2 10 1 1 3 5 7 8 6 2 4 1 4 1 9 6 6 2 8 7 3 8 10 1 7 6 1 3 8 10 5 9 4 9 10 1 1 6 6 7 3 9 5 3 6 10 2 2 6 9 3 10 4 10 7 6 1 6 3 8 9 2 9 6 7 7 10 4 8 10 7 6 7 10 3 4 10 3 1 3 8 7 3 4 2 5 1 ...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
7992
3684
3761
1617
8916
92
736
348
6273
63
113
637
83
648
131
242
42
467
54
76
755
225
6606
406
7559
1112
49
1411
5462
7112
359
3494
586
8880
4130
835
754
4004
120
8010
2458
3495
507
49
26
2624
4822
4229
58
264
657
81
656
119
1867
8231
54
10050
307
251
494
86...

result:

ok 102 lines

Test #4:

score: 0
Accepted
time: 12ms
memory: 10908kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 100
4547 4379 5838 2714 9394 8411 1892 791 1465 7401 5997 8178 5151 4873 7324 3859 4727 8682 5170 2686 3148 7413 5623 5264 2132 6619 1134 5120 2927 826 147 6065 7239 550 2813 5292 4848 6321 3710 9592 5014 5973 6559 6852 3363 198 4823 7881 9224 4018 4851 191...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
52719
67129
59750
66538
53093
63102
57652
28016
46641
62082
85963
65115
73771
61010
61401
65872
54147
47937
73083
66786
35930
57881
64963
64841
74820
21746
68255
59177
98803
71062
53051
62505
64403
47017
28540
54245
66274
53455
64550
53855
67980
44220
49543
52...

result:

ok 102 lines

Test #5:

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

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
2000 100
8141 764 1797 8119 6328 4665 7687 420 8174 8815 4641 1421 7313 1855 3498 3491 1084 3302 3333 4285 8567 1244 2907 1378 8001 2801 6755 2493 8405 8961 8523 120 808 5134 4477 7844 4806 9466 8461 9148 8234 9132 1848 4376 6836 7735 8708 4661 9938 3736 1348 251...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
59385
59377
57130
26938
59390
59398
59407
59378
59380
59407
57130
59405
57130
59404
57129
59393
59295
42277
59535
59380
59409
26577
59392
34492
57130
57130
59409
59395
59393
53055
59510
59398
59602
57130
59407
59377
59389
59385
38973
34594
59400
59400
59390
59...

result:

ok 102 lines

Test #6:

score: 0
Accepted
time: 6ms
memory: 12828kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 100
269 6998 1454 3473 3223 8923 883 6480 759 3448 6669 7537 7453 6217 5143 5685 7551 3009 1525 7765 3024 80 902 499 90 7964 3363 8494 3989 3273 2479 1708 8064 7539 5126 3726 9413 3537 5904 4017 1382 6178 7068 5610 964 5840 9623 1511 6772 4785 9109 866 2042...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
73187
61182
61152
90223
63019
61183
89591
36034
61148
61151
61189
55286
61173
39089
76739
68902
64578
63029
36027
61148
48847
27816
36041
61179
50918
71528
36033
49825
55276
65010
36110
27787
76640
55989
27808
64645
55806
43498
64573
61150
70180
73109
36095
61...

result:

ok 102 lines

Subtask #2:

score: 0
Time Limit Exceeded

Test #7:

score: 26
Accepted
time: 0ms
memory: 12016kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
1000 1000
1130998 3946545 6545866 7293696 9624001 5934576 91883 8467808 5293516 4377969 4270305 6396962 273361 88842 3015089 8325041 3690612 3735050 9510254 8527761 1038723 5522813 1877104 5699491 3708597 4192999 6479390 5728351 459885 627590 778790 9813273 44970...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
58554923
59397831
43907143
30396423
65329773
72733211
63602617
61768587
62204954
56621402
17618012
34979569
81400240
40358892
34992290
14843953
33603468
41098136
50889729
38925800
41083189
15432148
39749093
31453558
23471995
55658052
9381381
47354455
58490304
...

result:

ok 1002 lines

Test #8:

score: -26
Time Limit Exceeded

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
400000 50000
3 10 1 9 5 8 10 7 3 8 2 7 5 6 3 8 1 5 8 7 2 10 3 2 6 2 10 6 9 2 9 5 10 6 10 7 9 10 5 8 6 7 9 10 6 10 7 7 3 1 2 3 3 1 3 3 4 10 7 4 6 7 5 3 7 9 1 10 9 5 8 4 5 4 1 10 3 4 9 6 6 2 1 4 9 7 7 2 10 2 7 2 3 1 4 3 3 10 1 7 4 6 6 9 4 4 10 9 4 3 9 4 3 7 6 4 3 9...

output:

Unauthorized output

result:


Subtask #3:

score: 13
Accepted

Test #14:

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

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
1000 1000
2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 2918477 29184...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
17881661
33040130
34604564
25280961
28194570
23906798
15912230
29857216
28036550
24990418
20254260
16847281
36206803
19938498
34824909
24557488
26348424
25668821
22620286
24448869
27422275
16663870
17422116
22692168
15018428
21363378
17674438
14701572
21427171...

result:

ok 1002 lines

Test #15:

score: 0
Accepted
time: 44ms
memory: 47220kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 2671299 267...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
57444627
30638506
31612306
25428389
41281602
32571734
33830016
43854914
49556558
19628592
42889496
39731682
17955565
47360652
36351342
38170417
28981343
44668365
45347762
29769758
24486732
25948887
33222555
33033192
42479566
29471696
30285781
25081732
20379694...

result:

ok 50002 lines

Test #16:

score: 0
Accepted
time: 44ms
memory: 47132kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 4822500 482...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
91237758344
56798718481
58213038426
2952775546
75786438438
54505200466
150662848548
151777097031
157996669813
120440559935
155551706384
14231353298
139359032883
32245823847
153614854743
114524877618
144226128602
149382227142
86243233153
80444136066
10304964777...

result:

ok 50002 lines

Test #17:

score: 0
Accepted
time: 35ms
memory: 42008kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
7377028
9096325
6823007
9168333
985322
1430782
6281615
8519413
8329812
7559422
3246957
9264194
1980097
1854450
6271420
3705626
1726988
4284770
7788992
6152689
8340960
3961611
2243094
4219222
1551774
10052608
4418715
4369412
3434255
6431717
1166384
6716706
1799...

result:

ok 50002 lines

Test #18:

score: 0
Accepted
time: 35ms
memory: 45232kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
215566
662504
7967757
8373823
9147232
7391856
2563993
3063168
5940967
2693116
7152186
2919161
1414814
9043090
9003486
1447769
8936836
7049390
3253220
8275423
5626855
8965543
396841
8900139
223406
9266444
499479
3713378
2642994
9277999
6032800
3922678
10011177
...

result:

ok 50002 lines

Test #19:

score: 0
Accepted
time: 43ms
memory: 40280kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 3574781 357...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
44507393
42897398
46472175
17873925
42897387
46472157
51467701
42897398
50046943
46472219
60771289
50046942
53621719
28598288
42897446
42897456
42897427
50046969
65640025
60771287
39322625
46472174
35747842
42897410
28598276
42897417
42897378
39322613
42897412...

result:

ok 50002 lines

Test #20:

score: 0
Accepted
time: 45ms
memory: 41896kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 6436892 643...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
83679596
77242704
64368920
96553380
70805812
77242704
90470832
90116488
70805812
90116488
77242704
83679596
64368920
90116488
57932028
64368920
115864056
90116488
90116488
83679596
96553380
90116488
70805812
90116488
70805812
90116488
83679596
83679596
9011648...

result:

ok 50002 lines

Test #21:

score: 0
Accepted
time: 39ms
memory: 45156kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
267557
266437
282945
13162
276927
325842
83809
132172
320435
1720288
277697
255928
4088933
9376788
2011967
336229
1389482
54144
281297
338547
502658
61819
524200
383615
64811
237605
509795
299379
6345178
345651
823700
171376
55061
128273
1336638
10213892
14739...

result:

ok 50002 lines

Test #22:

score: 0
Accepted
time: 44ms
memory: 47424kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
22117
89
432597
143
500
60
91
2206271
76320
60
86
580
846054
136
725241
210
2685
2598481
155
37427
7307
55
3043
172
78
71
4341930
37542
66
32547
106200
124
9424
102
974024
2573
3307
470716
2194602
72
636760
1331
41630
24710
1440923
301
90
94
69
85
33286
151225...

result:

ok 50002 lines

Test #23:

score: 0
Accepted
time: 40ms
memory: 47416kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
77561
406533
15473
3460586
77339
1034161
31617
4673066
275721
726121
122139
203877
653079
51930
129181
3133578
46310
5025510
453619
62109
329817
56347
48669
85165
80591
81250
39725
362751
49052
5598528
78959
788594
73245
58312
85275
6144989
63026
15169
34552
7...

result:

ok 50002 lines

Test #24:

score: 0
Accepted
time: 43ms
memory: 40368kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 6428412 642...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
46411
41954
45359
45977
41159
46013
47253
48262
47179
46103
47338
45225
40389
49457
43216
45663
45858
49264
43064
42553
46555
49288
45764
41590
48803
46016
44808
48907
40717
48421
48572
44842
45648
43908
47572
48728
42099
40883
48834
42499
44452
45587
46295
45...

result:

ok 50002 lines

Test #25:

score: 0
Accepted
time: 69ms
memory: 40120kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
1290000000
3720000000
3090000000
3470000000
3490000000
2740000000
600000000
1790000000
2660000000
3690000000
1250000000
1860000000
640000000
3450000000
3330000000
760000000
3610000000
1270000000
2280000000
2500000000
170000000
3780000000
1870000000
2330000000
...

result:

ok 50002 lines

Test #26:

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

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000
20000000...

result:

ok 50002 lines

Subtask #4:

score: 0
Time Limit Exceeded

Test #27:

score: 12
Accepted
time: 2ms
memory: 9944kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
1000 1000
661 832 661 985 832 661 661 985 985 985 661 661 661 985 832 985 661 832 661 832 985 832 985 661 985 661 661 661 661 661 661 985 985 985 661 832 985 661 661 832 985 661 985 832 661 661 832 832 661 661 661 832 661 661 661 985 832 832 832 985 661 661 985 8...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
21024092
23787159
23041267
21350537
27120767
21292871
25822152
25512517
24195955
23172162
25636073
20984614
20875838
21163683
24384761
23377191
22223954
24378654
21075265
25399682
25364687
19645895
19114648
19277804
24098134
20586433
21081797
24061308
20465404...

result:

ok 1002 lines

Test #28:

score: 0
Accepted
time: 63ms
memory: 11748kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
891 891 262 262 891 891 262 262 891 262 262 891 891 262 262 891 891 891 262 262 262 262 262 891 891 262 262 891 891 891 262 891 262 262 262 262 262 891 891 262 891 891 891 891 262 262 262 891 262 891 262 262 891 891 262 262 891 262 262 891 262 262 262...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
17781107
17714843
17727076
17683907
17707973
17737039
17740420
17700705
17742003
17706598
17734408
17723457
17702595
17680818
17696863
17746408
17741545
17679963
17770134
17782588
17811602
17689945
18338901
17759125
17715206
17720871
17691907
17780424
18375323...

result:

ok 50002 lines

Test #29:

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

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
3665333 4946451 4946451 3665333 796498 796498 3665333 796498 4946451 796498 4946451 3665333 796498 4946451 796498 3665333 3665333 796498 3665333 3665333 4946451 3665333 4946451 3665333 796498 3665333 4946451 4946451 3665333 4946451 3665333 3665333 494...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
52763639
29424361
29541756
37715570
49059010
29830271
41561291
37719140
41048781
36287125
34553321
18307829
57836951
46839431
28670304
27842183
23872868
55390182
20056853
53532704
22853065
27697992
36199706
36450088
50702064
31413160
44653787
44269990
64168254...

result:

ok 50002 lines

Test #30:

score: 0
Accepted
time: 935ms
memory: 13712kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
634 581 581 642 634 642 667 667 667 634 634 642 581 634 642 667 581 642 642 581 581 642 634 667 634 667 642 667 634 634 634 634 642 581 634 642 642 667 642 634 634 642 642 581 667 667 581 667 581 642 642 642 642 581 581 642 634 634 642 634 642 642 642...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
12244222
11684979
18269057
12098352
18447142
8094367
3339443
17337948
8379732
18940026
14437552
11559807
8111923
18816813
9268431
18451342
17808047
15270560
19810281
16065096
4554566
22272991
19117842
18281014
9504228
11761477
10453787
18532611
13875094
133378...

result:

ok 50002 lines

Test #31:

score: 0
Accepted
time: 1017ms
memory: 13652kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
601 560 666 666 560 601 666 560 560 601 436 560 436 560 560 601 601 601 560 666 436 666 436 560 666 560 666 666 666 560 436 436 436 601 560 560 560 560 560 436 436 436 560 436 601 601 436 601 666 560 666 601 436 601 560 436 436 436 601 601 560 666 560...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
20184187
15193162
16596590
19858634
18684323
26599358
19847776
16290932
27005215
17759272
28120317
26140632
25014826
27932854
19274083
21461449
26989022
18500139
28283397
15734580
21779487
17572698
17289140
22164952
18363738
24913787
16533521
20757365
15787543...

result:

ok 50002 lines

Test #32:

score: 0
Accepted
time: 2846ms
memory: 15840kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
5539720 8696726 1880513 8696726 1880513 3071424 8696726 3071424 8696726 1880513 5539720 1880513 5539720 8696726 1880513 3071424 5539720 3071424 3071424 8696726 3071424 5539720 8696726 5539720 1880513 3071424 1880513 1880513 3071424 1880513 8696726 553...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
50106464
60009785
52846437
29468941
49917620
31936887
47237366
34420916
31936690
34421027
38165768
59062683
38165739
34420909
38683564
31936875
62204373
49917689
26396620
59062737
70126106
57661739
38683708
45484237
45484180
49917622
31936695
38581490
38683490...

result:

ok 50002 lines

Test #33:

score: 0
Accepted
time: 1820ms
memory: 13668kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
983 983 983 11 983 11 11 983 983 11 11 983 983 983 983 983 11 11 11 11 983 11 983 983 983 983 983 983 11 11 11 983 983 983 983 11 983 983 983 11 11 983 983 983 11 11 983 983 11 11 11 983 11 983 11 11 983 983 983 983 983 983 11 11 983 11 11 11 11 11 98...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
14383791
8430107
11961814
18124207
17850505
15912622
15874403
16428290
18124207
6201372
11317835
18123224
11979570
18124207
10454471
18125201
18124207
18124207
9543465
12164495
11804500
15845695
14730889
10459009
7622889
18123224
18124207
18123224
18124207
181...

result:

ok 50002 lines

Test #34:

score: 0
Accepted
time: 1753ms
memory: 15960kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
863 264 264 409 863 863 264 264 863 409 264 863 264 264 264 409 863 409 264 409 863 863 409 409 863 409 264 409 409 409 409 409 409 409 863 863 409 264 863 409 264 264 863 863 863 863 409 863 264 264 264 863 863 409 264 264 863 264 409 409 409 264 409...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
18708718
20396861
8996581
15798021
20943239
13521364
21190977
9938624
9219816
10492821
21476402
16163039
21435946
26235255
15187145
10386675
21476437
21165107
10155167
12582870
21476434
24644995
21471269
13755116
16211540
21450176
10066508
19398079
15800014
98...

result:

ok 50002 lines

Test #35:

score: 0
Accepted
time: 2148ms
memory: 13916kb

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
10000000 2 2 2 2 10000000 10000000 2 2 10000000 10000000 2 10000000 2 2 2 10000000 10000000 10000000 10000000 10000000 2 10000000 10000000 2 10000000 2 10000000 2 2 10000000 2 2 10000000 10000000 10000000 10000000 2 10000000 2 2 10000000 2 2 10000000 ...

output:

f39eb8f7-7d10-4b4a-af02-d7aef3d4dd0a
OK
28571
28806
16037
24370
1992
542
17729
21433
8542
28110
14308
8150
21287
25955
3763
9261
28980
25186
13003
7595
23564
25586
17519
11893
2264
5615
18153
16178
28373
6325
27619
11838
3853
5951
1481
3187
18333
7228
16739
16279
10314
20862
23518
19027
3852
12420
5...

result:

ok 50002 lines

Test #36:

score: -12
Time Limit Exceeded

input:

b50747e9-747c-4fca-b3b0-62317b32d2f6
50000 50000
200000 300000 500000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 100000...

output:

Unauthorized output

result:


Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%