QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#441486#8577. 평균 최대화GuanYunchang43 4943ms11952kbC++201.9kb2024-06-14 15:36:032024-06-14 15:36:04

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 9972kb

input:

10
2 4 3 9 9 9 9 9 9 1
2
0 2
0 9

output:

9 3
60 9

result:

ok correct!

Test #2:

score: 5
Accepted
time: 2ms
memory: 8160kb

input:

15
4596730 8340349 4612555 5692442 3914918 5213545 5248236 1276073 3844119 2943960 9231647 5091649 2239006 9139001 4735414
100
7 8
5 6
2 4
0 4
8 9
10 11
3 4
0 1
10 11
10 11
3 4
4 5
12 13
0 2
2 4
11 12
12 14
2 3
7 8
12 14
6 7
4 5
11 12
10 11
7 12
8 9
8 9
0 2
2 3
12 14
7 9
7 9
12 13
10 11
9 11
13 14
8...

output:

5120192 2
10461781 2
14219915 3
27156994 5
6788079 2
14323296 2
9607360 2
12937079 2
14323296 2
14323296 2
9607360 2
9128463 2
11378007 2
17549634 3
14219915 3
7330655 2
16113421 3
10304997 2
5120192 2
16113421 3
6524309 2
9128463 2
7330655 2
14323296 2
20782335 5
6788079 2
6788079 2
17549634 3
1030...

result:

ok correct!

Test #3:

score: 5
Accepted
time: 4457ms
memory: 10224kb

input:

15
962724 8815662 7612372 5708998 125165 5107756 9366378 9514244 2381600 4299006 9423670 8225791 7458292 2315903 7210561
600000
7 8
0 4
6 8
9 10
11 12
4 5
13 14
8 13
9 11
2 3
7 8
9 12
6 8
0 4
0 2
12 13
1 2
8 13
0 3
9 10
4 5
6 7
6 8
6 7
0 2
4 13
3 4
6 7
8 9
6 7
11 12
5 8
0 3
9 13
4 8
4 8
8 9
8 13
4 1...

output:

11895844 2
23224921 5
21262222 3
13722676 2
15684083 2
5232921 2
9526464 2
34104262 6
21948467 3
13321370 2
11895844 2
29406759 4
21262222 3
23224921 5
17390758 3
9774195 2
16428034 2
34104262 6
23099756 4
13722676 2
5232921 2
18880622 2
21262222 3
18880622 2
17390758 3
58217805 10
5834163 2
1888062...

result:

ok correct!

Test #4:

score: 5
Accepted
time: 2ms
memory: 10224kb

input:

15
1 8446287 2 999999 3000000 5533975 3000000 3816891 3000000 7671276 3000000 999999 5836790 8574548 1
23
0 14
1 2
0 1
2 14
0 2
3 11
2 3
4 6
3 4
5 6
4 5
6 8
7 8
6 7
8 10
9 10
8 9
10 11
11 14
12 14
11 12
13 14
12 13

output:

53879769 15
8446289 2
8446288 2
45433481 13
8446290 3
31022140 9
1000001 2
11533975 3
3999999 2
8533975 2
8533975 2
9816891 3
6816891 2
6816891 2
13671276 3
10671276 2
10671276 2
3999999 2
15411338 4
14411339 3
6836789 2
8574549 2
14411338 2

result:

ok correct!

Test #5:

score: 5
Accepted
time: 1ms
memory: 7976kb

input:

15
1 15 16 14 18 13 20 12 22 11 24 10 26 9 1
27
0 14
1 3
0 1
2 3
1 2
3 5
0 3
4 5
3 4
5 7
0 5
6 7
5 6
7 9
0 7
8 9
7 8
9 11
0 9
10 11
9 10
11 13
0 11
12 13
11 12
13 14
0 13

output:

212 15
45 3
16 2
30 2
31 2
45 3
46 4
31 2
32 2
45 3
77 6
32 2
33 2
45 3
109 8
33 2
34 2
45 3
142 10
34 2
35 2
45 3
176 12
35 2
36 2
10 2
211 14

result:

ok correct!

Subtask #2:

score: 6
Accepted

Dependency #1:

100%
Accepted

Test #6:

score: 6
Accepted
time: 10ms
memory: 10176kb

input:

48
225555 4046145 5839635 7194994 4703765 1253415 2526352 3198926 6313532 2368195 5024833 9436074 1792945 7650559 3393464 2402026 7697170 5205463 9830460 5392966 1687150 9984223 3014343 8856776 1412298 9773499 6469768 5802450 758943 2748325 7110370 4498454 2674137 8596714 8823659 9855644 6654297 367...

output:

24413198 4
16509941 2
17738394 3
45052203 9
17031286 4
24413198 4
11608824 2
45052203 9
17738394 3
13283417 3
9885780 2
23458015 4
14460907 2
5795490 2
25333600 3
11880653 3
7923098 2
23037954 5
131217114 26
22841241 3
10545933 2
17738394 3
13283417 3
18983962 3
17655565 3
11270851 2
8261027 2
13121...

result:

ok correct!

Test #7:

score: 6
Accepted
time: 4943ms
memory: 7864kb

input:

50
7121308 7345583 6899063 282017 6341784 3680369 5436234 9663519 633330 6333746 7783999 6482701 567072 4276742 8011254 1944632 5712778 8002712 306241 4160326 5728910 1328677 6357927 2565549 4232827 255999 3544802 2039097 494486 2383883 9963617 175242 2913048 5502915 9123911 4881811 2516781 8926134 ...

output:

5394962 2
12522742 3
14466891 2
12347500 2
4567430 2
14631630 3
6947205 2
14631630 3
15966363 4
75715129 17
15966363 4
12522742 3
6967076 2
3800801 2
6334384 4
2533583 2
69914912 15
4488826 2
75459130 16
14626826 2
2533583 2
15733083 3
15099753 2
10138859 2
75459130 16
8415963 2
4567430 2
10252153 3...

result:

ok correct!

Test #8:

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

input:

50
1 3859136 7745573 6119170 3863010 2 3 4 3498508 5 6608915 6662164 999999 3000000 7880751 3000000 4473437 3000000 7609368 3000000 4750778 3000000 8554401 3000000 5166495 3000000 4156171 3000000 9941061 3000000 7323881 3000000 3334344 3000000 3959127 3000000 999999 6 5 5322820 9189056 4 8127987 797...

output:

185663885 48
21586891 5
3859137 2
13864743 2
11604709 2
9982180 2
17723879 3
3863012 2
21586889 4
164076994 42
21586892 6
145705920 37
5 2
129598447 33
7 2
3498513 2
3498512 2
111127436 28
3498517 3
14271078 3
6608920 2
7662163 2
13271079 2
93700170 22
14271083 4
13880751 3
3999999 2
10880751 2
1088...

result:

ok correct!

Test #9:

score: 6
Accepted
time: 3ms
memory: 8160kb

input:

50
1 50 51 49 53 48 55 47 57 46 59 45 61 44 63 43 65 42 67 41 69 40 71 39 73 38 75 37 77 36 79 35 81 34 83 33 85 32 87 31 89 30 91 29 93 28 95 27 97 1
97
0 49
1 3
0 1
2 3
1 2
3 5
0 3
4 5
3 4
5 7
0 5
6 7
5 6
7 9
0 7
8 9
7 8
9 11
0 9
10 11
9 10
11 13
0 11
12 13
11 12
13 15
0 13
14 15
13 14
15 17
0 15
...

output:

1757 32
150 3
51 2
100 2
101 2
150 3
151 4
101 2
102 2
150 3
252 6
102 2
103 2
150 3
354 8
103 2
104 2
150 3
457 10
104 2
105 2
150 3
561 12
105 2
106 2
150 3
666 14
106 2
107 2
150 3
772 16
107 2
108 2
150 3
879 18
108 2
109 2
150 3
987 20
109 2
110 2
150 3
1096 22
110 2
111 2
150 3
1206 24
111 2
1...

result:

ok correct!

Subtask #3:

score: 0
Time Limit Exceeded

Dependency #2:

100%
Accepted

Test #10:

score: 0
Time Limit Exceeded

input:

240
6858784 4989917 9746109 9800650 9356541 6503323 7401498 4493451 2801567 3386165 2481047 9837911 8949606 8663384 5535990 833163 922389 2217653 4643612 8798924 859732 616449 7786902 4457600 9298353 6097782 1517199 1575123 3272602 8273488 8507227 5716403 4182244 3701458 1150320 7526997 7126600 8466...

output:

16368254 2
7471044 2
11386428 3
3195008 2
9658656 2
15523880 2
3140042 2
57491667 9
9688346 3
3267230 2
10959355 2
11038795 2
9761526 2
7883702 2
14605972 2
15088697 2
17640709 2
4918214 2
36301101 6
14887508 5
6296185 2
876017 2
6164558 2
13307829 3
19546759 2
8377911 2
14987510 3
20631197 3
183982...

result:


Subtask #4:

score: 7
Accepted

Test #15:

score: 7
Accepted
time: 79ms
memory: 8596kb

input:

300000
1 2 4 4 4 4 3 2 4 4 3 4 4 4 4 4 4 4 4 4 3 4 3 4 4 4 4 4 4 4 4 3 3 4 4 4 3 4 3 4 4 4 4 4 4 4 4 4 4 3 3 4 4 4 3 4 4 3 4 4 4 4 4 4 4 3 2 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 2 4 4 2 4 4 3 4 4 4 2 3 4 4 4 4 4 4 3 2 4 4 4 2 4 4 4 4 4 4 4 4 4 4 4 2 4 4 4 4 4 4 3 4 4 3 4 4 4 4 4 4 4 4 4...

output:

0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
...

result:

ok correct!

Subtask #5:

score: 0
Skipped

Dependency #3:

0%

Subtask #6:

score: 17
Accepted

Test #28:

score: 17
Accepted
time: 18ms
memory: 7988kb

input:

300000
1 300000 300001 299999 300003 299998 300005 299997 300007 299996 300009 299995 300011 299994 300013 299993 300015 299992 300017 299991 300019 299990 300021 299989 300023 299988 300025 299987 300027 299986 300029 299985 300031 299984 300033 299983 300035 299982 300037 299981 300039 299980 3000...

output:

0 0

result:

ok correct!

Test #29:

score: 17
Accepted
time: 7ms
memory: 8120kb

input:

262143
1 36 17 55 17 36 16 94 16 36 17 55 17 36 15 173 15 36 17 55 17 36 16 94 16 36 17 55 17 36 14 332 14 36 17 55 17 36 16 94 16 36 17 55 17 36 15 173 15 36 17 55 17 36 16 94 16 36 17 55 17 36 13 651 13 36 17 55 17 36 16 94 16 36 17 55 17 36 15 173 15 36 17 55 17 36 16 94 16 36 17 55 17 36 14 332 ...

output:

0 0

result:

ok correct!

Test #30:

score: 17
Accepted
time: 3ms
memory: 6040kb

input:

30000
1 8655519 5053769 2 3 4 5 6991720 3321347 8718018 4464302 8356978 6 7 8 8314637 5910310 3734266 7192139 9183941 9 4352483 6266035 4417558 10 6855725 6999520 4363735 11 12 3499845 8360666 13 14 15 16 9638440 7317746 17 9282787 18 7466678 7930596 9367029 9821794 19 9771448 5441062 6451096 328952...

output:

0 0

result:

ok correct!

Test #31:

score: 17
Accepted
time: 20ms
memory: 8252kb

input:

290000
1 2 6720098 9810682 9668570 8703077 7145578 8284345 5251625 6142206 3 4 5 6 9581548 3001002 3225039 8794590 7 7045505 4451229 5589636 8 5839563 9 4221964 4476182 9093685 6987982 8939207 10 5185060 5575428 4771993 6420287 11 5731640 9062305 12 4033948 6267196 9720880 9696770 8607688 7778692 13...

output:

0 0

result:

ok correct!

Test #32:

score: 17
Accepted
time: 21ms
memory: 8628kb

input:

300000
1 8082711 2 3 4 8191165 3057929 5 3281578 6 6806849 5907196 7 9351806 3531744 7705686 6432789 9157615 8 9 6375173 10 11 9085831 12 8260525 5405870 5874520 5080934 9030605 4739400 3087365 13 14 3952382 8426580 15 3670130 3487971 16 9726802 6241396 5894014 9251026 17 3933416 6097186 8936104 857...

output:

0 0

result:

ok correct!

Test #33:

score: 17
Accepted
time: 13ms
memory: 6600kb

input:

300000
1 30001 30002 30000 30004 29999 30006 29998 30008 29997 30010 29996 30012 29995 30014 29994 30016 29993 30018 29992 30020 29991 30022 29990 30024 29989 30026 29988 30028 29987 30030 29986 30032 29985 30034 29984 30036 29983 30038 29982 30040 29981 30042 29980 30044 29979 30046 29978 30048 299...

output:

0 0

result:

ok correct!

Test #34:

score: 17
Accepted
time: 19ms
memory: 8572kb

input:

300000
1 30001 30002 30000 30004 29999 30006 29998 30008 29997 30010 29996 30012 29995 30014 29994 30016 29993 30018 29992 30020 29991 30022 29990 30024 29989 30026 29988 30028 29987 30030 29986 30032 29985 30034 29984 30036 29983 30038 29982 30040 29981 30042 29980 30044 29979 30046 29978 30048 299...

output:

0 0

result:

ok correct!

Test #35:

score: 17
Accepted
time: 11ms
memory: 7872kb

input:

300000
1 30001 30002 30000 30004 29999 30006 29998 30008 29997 30010 29996 30012 29995 30014 29994 30016 29993 30018 29992 30020 29991 30022 29990 30024 29989 30026 29988 30028 29987 30030 29986 30032 29985 30034 29984 30036 29983 30038 29982 30040 29981 30042 29980 30044 29979 30046 29978 30048 299...

output:

0 0

result:

ok correct!

Test #36:

score: 17
Accepted
time: 19ms
memory: 6532kb

input:

300000
1 100001 100002 100000 100004 99999 100006 99998 100008 99997 100010 99996 100012 99995 100014 99994 100016 99993 100018 99992 100020 99991 100022 99990 100024 99989 100026 99988 100028 99987 100030 99986 100032 99985 100034 99984 100036 99983 100038 99982 100040 99981 100042 99980 100044 999...

output:

0 0

result:

ok correct!

Test #37:

score: 17
Accepted
time: 19ms
memory: 6896kb

input:

300000
1 100001 100002 100000 100004 99999 100006 99998 100008 99997 100010 99996 100012 99995 100014 99994 100016 99993 100018 99992 100020 99991 100022 99990 100024 99989 100026 99988 100028 99987 100030 99986 100032 99985 100034 99984 100036 99983 100038 99982 100040 99981 100042 99980 100044 999...

output:

0 0

result:

ok correct!

Test #38:

score: 17
Accepted
time: 14ms
memory: 7580kb

input:

300000
1 100001 100002 100000 100004 99999 100006 99998 100008 99997 100010 99996 100012 99995 100014 99994 100016 99993 100018 99992 100020 99991 100022 99990 100024 99989 100026 99988 100028 99987 100030 99986 100032 99985 100034 99984 100036 99983 100038 99982 100040 99981 100042 99980 100044 999...

output:

0 0

result:

ok correct!

Test #39:

score: 17
Accepted
time: 12ms
memory: 8660kb

input:

300000
1 1001 1002 1000 1004 999 1006 998 1008 997 1010 996 1012 995 1014 994 1016 993 1018 992 1020 991 1022 990 1024 989 1026 988 1028 987 1030 986 1032 985 1034 984 1036 983 1038 982 1040 981 1042 980 1044 979 1046 978 1048 977 1050 976 1052 975 1054 974 1056 973 1058 972 1060 971 1062 970 1064 9...

output:

0 0

result:

ok correct!

Test #40:

score: 17
Accepted
time: 6ms
memory: 8612kb

input:

300000
1 1001 1002 1000 1004 999 1006 998 1008 997 1010 996 1012 995 1014 994 1016 993 1018 992 1020 991 1022 990 1024 989 1026 988 1028 987 1030 986 1032 985 1034 984 1036 983 1038 982 1040 981 1042 980 1044 979 1046 978 1048 977 1050 976 1052 975 1054 974 1056 973 1058 972 1060 971 1062 970 1064 9...

output:

0 0

result:

ok correct!

Test #41:

score: 17
Accepted
time: 16ms
memory: 7016kb

input:

300000
1 1001 1002 1000 1004 999 1006 998 1008 997 1010 996 1012 995 1014 994 1016 993 1018 992 1020 991 1022 990 1024 989 1026 988 1028 987 1030 986 1032 985 1034 984 1036 983 1038 982 1040 981 1042 980 1044 979 1046 978 1048 977 1050 976 1052 975 1054 974 1056 973 1058 972 1060 971 1062 970 1064 9...

output:

0 0

result:

ok correct!

Test #42:

score: 17
Accepted
time: 18ms
memory: 8328kb

input:

300000
1 843582 2 873021 3 643266 4 825520 5 612939 6 642259 7 867008 8 688306 9 735154 10 728530 11 855292 12 766900 13 680592 14 756837 15 644649 16 886591 17 718665 18 883840 19 603356 20 877389 21 657101 22 799281 23 859838 24 818703 25 708095 26 833634 27 819313 28 837566 29 621548 30 603778 31...

output:

0 0

result:

ok correct!

Test #43:

score: 17
Accepted
time: 19ms
memory: 8048kb

input:

300000
1 6835493 2 4021139 3 4948020 4 9277118 5 4836220 6 7333822 7 5477584 8 8207990 9 4016733 10 9290125 11 8744708 12 6270566 13 5111629 14 8762765 15 5761419 16 9228542 17 5577763 18 6444537 19 5966457 20 4038485 21 9462991 22 6349304 23 7657234 24 9631830 25 6433737 26 9269204 27 4684626 28 74...

output:

0 0

result:

ok correct!

Subtask #7:

score: 8
Accepted

Dependency #4:

100%
Accepted

Test #44:

score: 8
Accepted
time: 87ms
memory: 6876kb

input:

300000
1 18 20 20 20 18 20 19 19 20 20 20 20 20 20 20 20 20 20 20 20 20 13 20 18 20 20 20 20 20 20 20 16 20 20 20 20 20 20 19 18 20 20 20 20 20 18 20 20 20 20 19 20 20 20 20 20 20 20 20 20 20 14 19 20 20 19 20 20 20 19 19 20 18 18 12 20 19 20 20 20 20 20 20 20 11 20 20 14 20 19 19 20 20 20 20 20 20 ...

output:

0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
...

result:

ok correct!

Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%