Task: | Uolevi and Market |
Sender: | Pietari Kaskela |
Submission time: | 2017-09-26 18:25:06 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.05 s | details |
#2 | ACCEPTED | 0.05 s | details |
#3 | WRONG ANSWER | 1.45 s | details |
#4 | WRONG ANSWER | 1.67 s | details |
#5 | WRONG ANSWER | 1.62 s | details |
#6 | WRONG ANSWER | 1.74 s | details |
#7 | WRONG ANSWER | 1.62 s | details |
#8 | ACCEPTED | 1.13 s | details |
#9 | WRONG ANSWER | 1.14 s | details |
#10 | ACCEPTED | 1.24 s | details |
#11 | WRONG ANSWER | 1.16 s | details |
#12 | ACCEPTED | 1.21 s | details |
#13 | WRONG ANSWER | 1.12 s | details |
#14 | ACCEPTED | 1.25 s | details |
#15 | WRONG ANSWER | 1.16 s | details |
#16 | WRONG ANSWER | 1.12 s | details |
#17 | WRONG ANSWER | 1.18 s | details |
#18 | WRONG ANSWER | 1.03 s | details |
#19 | WRONG ANSWER | 1.18 s | details |
#20 | WRONG ANSWER | 1.06 s | details |
#21 | WRONG ANSWER | 1.12 s | details |
#22 | WRONG ANSWER | 1.08 s | details |
#23 | WRONG ANSWER | 1.19 s | details |
#24 | WRONG ANSWER | 0.92 s | details |
#25 | WRONG ANSWER | 1.15 s | details |
#26 | WRONG ANSWER | 0.89 s | details |
#27 | WRONG ANSWER | 1.09 s | details |
#28 | WRONG ANSWER | 0.98 s | details |
#29 | WRONG ANSWER | 1.29 s | details |
#30 | WRONG ANSWER | 1.40 s | details |
#31 | WRONG ANSWER | 1.15 s | details |
#32 | WRONG ANSWER | 1.31 s | details |
#33 | WRONG ANSWER | 1.43 s | details |
#34 | WRONG ANSWER | 1.20 s | details |
#35 | WRONG ANSWER | 1.23 s | details |
#36 | WRONG ANSWER | 1.19 s | details |
#37 | WRONG ANSWER | 1.28 s | details |
#38 | WRONG ANSWER | 0.78 s | details |
#39 | WRONG ANSWER | 1.23 s | details |
#40 | WRONG ANSWER | 1.29 s | details |
#41 | WRONG ANSWER | 1.15 s | details |
#42 | WRONG ANSWER | 1.12 s | details |
#43 | WRONG ANSWER | 1.04 s | details |
#44 | WRONG ANSWER | 1.06 s | details |
#45 | ACCEPTED | 0.95 s | details |
#46 | WRONG ANSWER | 1.18 s | details |
#47 | WRONG ANSWER | 1.33 s | details |
#48 | WRONG ANSWER | 1.13 s | details |
#49 | WRONG ANSWER | 1.06 s | details |
#50 | WRONG ANSWER | 1.22 s | details |
#51 | WRONG ANSWER | 1.07 s | details |
#52 | WRONG ANSWER | 1.12 s | details |
#53 | WRONG ANSWER | 0.60 s | details |
#54 | WRONG ANSWER | 0.49 s | details |
#55 | WRONG ANSWER | 0.54 s | details |
#56 | WRONG ANSWER | 0.48 s | details |
#57 | WRONG ANSWER | 0.50 s | details |
#58 | WRONG ANSWER | 0.50 s | details |
#59 | WRONG ANSWER | 0.49 s | details |
#60 | WRONG ANSWER | 0.47 s | details |
#61 | WRONG ANSWER | 0.52 s | details |
#62 | WRONG ANSWER | 0.48 s | details |
#63 | WRONG ANSWER | 0.49 s | details |
Code
#include <bits/stdc++.h> using namespace std; int64_t n, k; int64_t p[202020]; int main(){ cin >> n >> k; for(int i = 0; i < n; ++i) cin >> p[i]; sort(p, p+n); set<pair<int64_t, int>> h; h.insert({p[0], 0}); while(k--){ auto cur = *h.begin(); h.erase(h.begin()); if(k == 0){ cout << cur.first << "\n"; return 0; } if(cur.second < n-1){ h.insert({cur.first-p[cur.second]+p[cur.second+1], cur.second+1}); h.insert({cur.first+p[cur.second+1], cur.second+1}); } } return 0; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
5 30 4 2 1 16 8 |
correct output |
---|
30 |
user output |
---|
30 |
Test 2
Verdict: ACCEPTED
input |
---|
4 5 1 1 2 2 |
correct output |
---|
2 |
user output |
---|
2 |
Test 3
Verdict: WRONG ANSWER
input |
---|
200000 1000000 35914537 42647291 87909684 169... |
correct output |
---|
40048 |
user output |
---|
54221 |
Test 4
Verdict: WRONG ANSWER
input |
---|
200000 999997 61014077 43650830 20341927 512... |
correct output |
---|
26287 |
user output |
---|
43222 |
Test 5
Verdict: WRONG ANSWER
input |
---|
200000 999994 70240264 96093067 55381233 200... |
correct output |
---|
47716 |
user output |
---|
58504 |
Test 6
Verdict: WRONG ANSWER
input |
---|
200000 1000000 35649442 14455142 42097661 264... |
correct output |
---|
37463 |
user output |
---|
50103 |
Test 7
Verdict: WRONG ANSWER
input |
---|
200000 999999 13117573 51346250 57165442 573... |
correct output |
---|
48524 |
user output |
---|
62057 |
Test 8
Verdict: ACCEPTED
input |
---|
200000 1000000 74133476 67906882 94159121 910... |
correct output |
---|
100448091 |
user output |
---|
100448091 |
Test 9
Verdict: WRONG ANSWER
input |
---|
200000 999995 93614670 59747155 91096808 981... |
correct output |
---|
100439561 |
user output |
---|
100440176 |
Test 10
Verdict: ACCEPTED
input |
---|
200000 999995 77940809 63268835 58552239 837... |
correct output |
---|
100435546 |
user output |
---|
100435546 |
Test 11
Verdict: WRONG ANSWER
input |
---|
200000 999999 93402872 57557618 74759064 708... |
correct output |
---|
100441107 |
user output |
---|
100441486 |
Test 12
Verdict: ACCEPTED
input |
---|
200000 999991 83612399 82124316 69515438 975... |
correct output |
---|
100450517 |
user output |
---|
100450517 |
Test 13
Verdict: WRONG ANSWER
input |
---|
200000 999999 53962426 90332194 89669526 527... |
correct output |
---|
67278906 |
user output |
---|
67278937 |
Test 14
Verdict: ACCEPTED
input |
---|
200000 999994 78077015 71621402 94228781 627... |
correct output |
---|
67288062 |
user output |
---|
67288062 |
Test 15
Verdict: WRONG ANSWER
input |
---|
200000 999998 61448236 93649865 83826482 685... |
correct output |
---|
67289186 |
user output |
---|
67289794 |
Test 16
Verdict: WRONG ANSWER
input |
---|
200000 999998 42674581 80397818 85436433 525... |
correct output |
---|
67277799 |
user output |
---|
67278816 |
Test 17
Verdict: WRONG ANSWER
input |
---|
200000 999992 87054268 82500803 58062748 907... |
correct output |
---|
67292946 |
user output |
---|
67293761 |
Test 18
Verdict: WRONG ANSWER
input |
---|
118 999990 24606314 26881915 83697723 314... |
correct output |
---|
59893004 |
user output |
---|
59902732 |
Test 19
Verdict: WRONG ANSWER
input |
---|
114 999990 7508556 44887712 13807527 1373... |
correct output |
---|
58898150 |
user output |
---|
58923581 |
Test 20
Verdict: WRONG ANSWER
input |
---|
60 999999 70830090 54903764 84787294 592... |
correct output |
---|
131136907 |
user output |
---|
131148185 |
Test 21
Verdict: WRONG ANSWER
input |
---|
60 999995 26547370 1696909 47532807 4204... |
correct output |
---|
120528479 |
user output |
---|
120551927 |
Test 22
Verdict: WRONG ANSWER
input |
---|
82 999991 30344020 85572550 14839656 688... |
correct output |
---|
84360885 |
user output |
---|
84372590 |
Test 23
Verdict: WRONG ANSWER
input |
---|
115 999995 54759837 94799018 75148969 609... |
correct output |
---|
265227849 |
user output |
---|
265230206 |
Test 24
Verdict: WRONG ANSWER
input |
---|
92 999998 83834052 81737375 96920614 974... |
correct output |
---|
290583555 |
user output |
---|
290587789 |
Test 25
Verdict: WRONG ANSWER
input |
---|
118 999990 67250889 58936420 59051268 534... |
correct output |
---|
259448394 |
user output |
---|
259471886 |
Test 26
Verdict: WRONG ANSWER
input |
---|
84 1000000 93928620 74036291 93350031 581... |
correct output |
---|
298797537 |
user output |
---|
298805683 |
Test 27
Verdict: WRONG ANSWER
input |
---|
116 1000000 57328438 70122878 82388890 502... |
correct output |
---|
257886720 |
user output |
---|
257892676 |
Test 28
Verdict: WRONG ANSWER
input |
---|
64 999994 66326096 74371473 35345424 605... |
correct output |
---|
261238357 |
user output |
---|
261245912 |
Test 29
Verdict: WRONG ANSWER
input |
---|
101 999991 76537247 62075235 55562035 409... |
correct output |
---|
223349203 |
user output |
---|
223350989 |
Test 30
Verdict: WRONG ANSWER
input |
---|
96 999992 54160104 62176925 57826972 657... |
correct output |
---|
222688987 |
user output |
---|
222709736 |
Test 31
Verdict: WRONG ANSWER
input |
---|
93 999997 85439260 80904987 73271551 933... |
correct output |
---|
227876438 |
user output |
---|
227878178 |
Test 32
Verdict: WRONG ANSWER
input |
---|
92 999995 77813962 94408431 56259996 683... |
correct output |
---|
234405809 |
user output |
---|
234409433 |
Test 33
Verdict: WRONG ANSWER
input |
---|
112 999990 49974705 72633033 41677908 918... |
correct output |
---|
178928274 |
user output |
---|
178930619 |
Test 34
Verdict: WRONG ANSWER
input |
---|
105 999992 76300298 77811005 27684325 765... |
correct output |
---|
186022493 |
user output |
---|
186024575 |
Test 35
Verdict: WRONG ANSWER
input |
---|
71 999999 62693484 87177530 45066123 393... |
correct output |
---|
215438196 |
user output |
---|
215441315 |
Test 36
Verdict: WRONG ANSWER
input |
---|
116 1000000 90037623 54173518 87617924 724... |
correct output |
---|
178731024 |
user output |
---|
178733909 |
Test 37
Verdict: WRONG ANSWER
input |
---|
106 999998 36516564 42111213 44365846 869... |
correct output |
---|
194634751 |
user output |
---|
194651748 |
Test 38
Verdict: WRONG ANSWER
input |
---|
840 999999 26237876 15602392 84690614 992... |
correct output |
---|
5721937 |
user output |
---|
5734063 |
Test 39
Verdict: WRONG ANSWER
input |
---|
943 999993 56464921 36827489 64259440 549... |
correct output |
---|
6098943 |
user output |
---|
6121350 |
Test 40
Verdict: WRONG ANSWER
input |
---|
1842 999999 22720484 18646774 73741679 151... |
correct output |
---|
4474692 |
user output |
---|
4484022 |
Test 41
Verdict: WRONG ANSWER
input |
---|
1279 999994 94762285 14088940 1644295 8200... |
correct output |
---|
4231961 |
user output |
---|
4240432 |
Test 42
Verdict: WRONG ANSWER
input |
---|
1697 999998 97851850 63055272 31579609 528... |
correct output |
---|
4628295 |
user output |
---|
4637817 |
Test 43
Verdict: WRONG ANSWER
input |
---|
807 999994 92111097 66175026 65616513 950... |
correct output |
---|
170077689 |
user output |
---|
170078609 |
Test 44
Verdict: WRONG ANSWER
input |
---|
1419 999994 50559319 94606341 98969606 999... |
correct output |
---|
158038991 |
user output |
---|
158039608 |
Test 45
Verdict: ACCEPTED
input |
---|
1453 999998 53864345 60040214 63738530 676... |
correct output |
---|
158550902 |
user output |
---|
158550902 |
Test 46
Verdict: WRONG ANSWER
input |
---|
1252 999999 90006245 55183477 96168215 564... |
correct output |
---|
159567145 |
user output |
---|
159567956 |
Test 47
Verdict: WRONG ANSWER
input |
---|
1341 999990 87329698 93796250 60725827 954... |
correct output |
---|
159902950 |
user output |
---|
159903306 |
Test 48
Verdict: WRONG ANSWER
input |
---|
1440 999997 97841217 83382136 35620107 810... |
correct output |
---|
113524436 |
user output |
---|
113526591 |
Test 49
Verdict: WRONG ANSWER
input |
---|
1826 999991 54543844 47545004 40426026 510... |
correct output |
---|
109879435 |
user output |
---|
109880934 |
Test 50
Verdict: WRONG ANSWER
input |
---|
887 1000000 34460498 71787503 33446890 636... |
correct output |
---|
122498648 |
user output |
---|
122500796 |
Test 51
Verdict: WRONG ANSWER
input |
---|
1170 999990 85096647 86660620 49474653 542... |
correct output |
---|
115613417 |
user output |
---|
115614079 |
Test 52
Verdict: WRONG ANSWER
input |
---|
835 999993 54480677 51249282 39409673 833... |
correct output |
---|
125841387 |
user output |
---|
125843652 |
Test 53
Verdict: WRONG ANSWER
input |
---|
200000 999995 100000000 100000000 100000000 ... |
correct output |
---|
200000000 |
user output |
---|
600000000 |
Test 54
Verdict: WRONG ANSWER
input |
---|
200000 999994 2761 2821 4103 1824 1499 2287 ... |
correct output |
---|
1485 |
user output |
---|
1866 |
Test 55
Verdict: WRONG ANSWER
input |
---|
200000 1000000 2242 3461 1843 4422 3117 1682 ... |
correct output |
---|
1484 |
user output |
---|
1897 |
Test 56
Verdict: WRONG ANSWER
input |
---|
200000 999996 1727 4798 1438 4369 2651 4268 ... |
correct output |
---|
1497 |
user output |
---|
1848 |
Test 57
Verdict: WRONG ANSWER
input |
---|
200000 999990 3944 1053 4668 3351 3236 4781 ... |
correct output |
---|
1496 |
user output |
---|
1820 |
Test 58
Verdict: WRONG ANSWER
input |
---|
200000 999996 1964 3445 3391 4307 2742 3853 ... |
correct output |
---|
1523 |
user output |
---|
1815 |
Test 59
Verdict: WRONG ANSWER
input |
---|
200000 999993 3051 4465 4099 2105 2142 3553 ... |
correct output |
---|
1493 |
user output |
---|
1822 |
Test 60
Verdict: WRONG ANSWER
input |
---|
200000 999990 2957 3354 3456 1009 4854 4747 ... |
correct output |
---|
1543 |
user output |
---|
1815 |
Test 61
Verdict: WRONG ANSWER
input |
---|
200000 999998 1371 2549 3797 3247 3424 2800 ... |
correct output |
---|
1506 |
user output |
---|
1798 |
Test 62
Verdict: WRONG ANSWER
input |
---|
200000 999992 4081 4463 3326 4078 3790 4232 ... |
correct output |
---|
1544 |
user output |
---|
1824 |
Test 63
Verdict: WRONG ANSWER
input |
---|
200000 999994 2660 2489 2599 2268 2084 3274 ... |
correct output |
---|
1484 |
user output |
---|
1903 |