QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#537593#4564. Digital Circuitegypt_ioi2024_01#9 44ms4256kbC++231.2kb2024-08-30 16:22:392024-08-30 16:22:39

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 2
Accepted

Test #1:

score: 2
Accepted
time: 1ms
memory: 4024kb

input:

1 2
-1 0 0
0 0
1 1
2 2
1 2
2 2
1 2
-1 -1
-2 -2

output:

1
2
0
1
1

result:

ok 7 lines

Test #2:

score: 2
Accepted
time: 1ms
memory: 4056kb

input:

1 1
-1 0
0
1 1
1 1
1 1
1 1
-1 -1
-2 -2

output:

1
0
1
0

result:

ok 6 lines

Test #3:

score: 2
Accepted
time: 38ms
memory: 3884kb

input:

1 972
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

509
483
489
500
481

result:

ok 7 lines

Test #4:

score: 2
Accepted
time: 44ms
memory: 3748kb

input:

1 1000
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

4
40
428
262
237

result:

ok 7 lines

Test #5:

score: 2
Accepted
time: 44ms
memory: 3824kb

input:

1 1000
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

898
828
828
617
582

result:

ok 7 lines

Test #6:

score: 2
Accepted
time: 44ms
memory: 3760kb

input:

1 1000
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

535
494
500
498
509

result:

ok 7 lines

Test #7:

score: 2
Accepted
time: 40ms
memory: 3800kb

input:

1 1000
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

517
486
511
487
512

result:

ok 7 lines

Test #8:

score: 2
Accepted
time: 44ms
memory: 4052kb

input:

1 1000
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

501
500
499
500
501

result:

ok 7 lines

Subtask #2:

score: 7
Accepted

Test #9:

score: 7
Accepted
time: 1ms
memory: 3792kb

input:

1 2
-1 0 0
0 0
1 1
2 2
1 2
2 2
1 2
-1 -1
-2 -2

output:

1
2
0
1
1

result:

ok 7 lines

Test #10:

score: 7
Accepted
time: 1ms
memory: 3796kb

input:

255 256
-1 0 0 1 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 ...

output:

52130940
785285606
585825652

result:

ok 5 lines

Test #11:

score: 7
Accepted
time: 1ms
memory: 3800kb

input:

511 512
-1 0 0 1 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 ...

output:

655368480
979089518
133738288
486298234
70832346

result:

ok 7 lines

Test #12:

score: 7
Accepted
time: 1ms
memory: 3808kb

input:

511 512
-1 0 0 1 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 ...

output:

640949026
225483138
810019272
225483138
640949026

result:

ok 7 lines

Test #13:

score: 7
Accepted
time: 1ms
memory: 3828kb

input:

511 512
-1 0 0 1 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 ...

output:

655368480
457459326
408972838
872925214
486298234

result:

ok 7 lines

Test #14:

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

input:

726 727
-1 0 0 2 1 1 2 3 5 7 9 4 9 7 6 6 11 8 16 12 17 19 3 14 18 16 15 25 10 10 8 27 26 24 20 30 14 18 33 32 4 40 12 25 30 22 43 45 39 46 13 33 23 13 35 26 31 15 57 47 38 22 37 28 41 55 39 43 23 29 64 17 49 67 24 36 55 5 59 62 63 59 48 28 70 11 71 74 76 56 84 66 88 88 56 58 77 27 79 38 74 98 95 44 ...

output:

706880838
491517432

result:

ok 4 lines

Test #15:

score: 7
Accepted
time: 2ms
memory: 3848kb

input:

999 1000
-1 0 1 1 0 4 2 5 5 8 8 3 7 9 6 4 15 16 7 2 11 13 13 18 21 23 12 10 6 20 29 18 16 19 14 31 24 34 35 17 28 26 27 31 29 25 45 43 33 46 32 23 27 42 48 14 15 42 45 37 12 41 59 43 51 57 3 47 40 38 39 64 66 21 56 19 61 59 58 55 26 11 40 77 63 82 48 85 58 53 56 10 22 75 92 91 92 47 81 52 71 96 100 ...

output:

942041994
438937124
841357772
232099870
90068874

result:

ok 7 lines

Test #16:

score: 7
Accepted
time: 1ms
memory: 3840kb

input:

999 1000
-1 0 1 2 3 0 3 6 5 8 6 8 11 9 1 14 10 12 10 13 2 20 4 17 22 13 12 26 15 11 14 27 31 4 30 19 32 18 32 21 38 36 30 19 17 25 23 25 39 27 48 40 41 41 47 38 46 56 54 56 34 45 20 52 57 58 62 65 65 29 40 43 28 54 5 34 26 15 61 67 49 9 43 46 73 76 68 79 87 83 81 47 82 92 68 52 28 86 69 60 93 71 71 ...

output:

846777934
543886020
117265458
170290282
281705356

result:

ok 7 lines

Test #17:

score: 7
Accepted
time: 1ms
memory: 3868kb

input:

999 1000
-1 0 1 0 1 4 2 5 3 2 5 6 3 9 8 6 7 10 15 14 8 11 18 22 19 12 4 25 22 12 21 7 31 17 15 13 30 27 18 11 38 36 27 42 42 40 37 9 13 20 29 10 49 47 43 34 50 55 19 58 28 17 47 48 35 64 36 64 61 33 37 33 62 16 24 53 67 65 73 70 29 26 54 58 69 51 75 14 82 59 59 77 80 63 46 90 56 30 77 94 39 49 68 66...

output:

705376374
644042668
670552036

result:

ok 5 lines

Test #18:

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

input:

999 1000
-1 0 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 9...

output:

934163262
112313082
337041484
769464108
426960866

result:

ok 7 lines

Test #19:

score: 7
Accepted
time: 2ms
memory: 4256kb

input:

999 1000
-1 0 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 9...

output:

824177488
180713918
915259054
915239172
406741568

result:

ok 7 lines

Test #20:

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

input:

848 849
-1 0 0 1 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 ...

output:

740267208
421935812
842353974
899432906
740267208

result:

ok 7 lines

Subtask #3:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #21:

score: 0
Wrong Answer
time: 1ms
memory: 4116kb

input:

722 938
-1 0 0 0 3 4 0 0 4 2 8 6 6 0 0 12 0 9 12 4 10 18 18 16 6 7 25 6 6 19 27 22 2 11 19 10 14 9 35 16 25 23 25 6 39 14 23 44 36 2 49 11 47 43 32 37 27 23 34 6 43 21 0 32 28 64 12 2 49 49 56 14 70 67 67 27 18 24 75 39 13 53 27 71 77 69 0 32 19 88 66 15 90 71 74 94 28 86 63 80 89 0 69 65 3 104 56 1...

output:

209107816
-42519720
-13764508
808252076

result:

wrong answer 3rd lines differ - expected: '759476520', found: '209107816'

Subtask #4:

score: 0
Time Limit Exceeded

Test #43:

score: 0
Time Limit Exceeded

input:

32767 32768
-1 0 0 1 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...

output:

431985922
394586018
431985922
469385826
506785730
469385826
431985922
469385826
431985922
469385826
506785730
469385826
431985922
394586018
357186114
319786210
357186114
394586018
431985922
394586018
357186114
394586018
431985922
469385826
506785730
469385826
431985922
394586018
357186114
319786210
...

result:


Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Time Limit Exceeded

Dependency #2:

100%
Accepted

Test #55:

score: 0
Time Limit Exceeded

input:

98261 98262
-1 0 0 1 2 2 4 5 3 8 6 6 1 10 13 10 9 5 12 11 18 17 20 4 18 19 24 11 26 27 24 29 17 29 25 34 7 7 13 21 16 9 23 38 33 25 28 21 37 48 40 46 43 38 49 27 41 22 42 39 58 36 56 32 42 61 22 30 36 47 68 67 59 66 58 23 3 52 39 44 12 8 51 26 74 76 81 65 53 19 59 90 20 83 54 90 77 37 70 67 68 48 73...

output:

732332002
281856764
14589944
411925198
494975700
394036962
773421578
775146066
4883078
260203704
903670862
346009340
587339956
274764376
460788066
389167006
366495594
540344200
552587736
827184842
811178920
435730860
31164648
948570022
596481960
285872536
249124126
542862090
457661798
194120298
6299...

result:


Subtask #7:

score: 0
Skipped

Dependency #3:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%