Task: | Palembang Bridges |
Sender: | Yytsi |
Submission time: | 2019-04-08 00:15:04 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
#4 | WRONG ANSWER | 0 |
#5 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.01 s | 1, 2 | details |
#2 | ACCEPTED | 0.02 s | 1, 2 | details |
#3 | WRONG ANSWER | 0.02 s | 1, 2 | details |
#4 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#5 | WRONG ANSWER | 0.02 s | 1, 2 | details |
#6 | WRONG ANSWER | 0.02 s | 1, 2 | details |
#7 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#8 | WRONG ANSWER | 0.03 s | 1, 2 | details |
#9 | WRONG ANSWER | 0.02 s | 1, 2 | details |
#10 | WRONG ANSWER | 0.03 s | 1, 2 | details |
#11 | WRONG ANSWER | 0.02 s | 1, 2 | details |
#12 | WRONG ANSWER | 0.05 s | 2 | details |
#13 | WRONG ANSWER | 0.07 s | 2 | details |
#14 | WRONG ANSWER | 0.07 s | 2 | details |
#15 | WRONG ANSWER | 0.06 s | 2 | details |
#16 | WRONG ANSWER | 0.07 s | 2 | details |
#17 | WRONG ANSWER | 0.07 s | 2 | details |
#18 | WRONG ANSWER | 0.07 s | 2 | details |
#19 | WRONG ANSWER | 0.07 s | 2 | details |
#20 | WRONG ANSWER | 0.07 s | 2 | details |
#21 | WRONG ANSWER | 0.07 s | 2 | details |
#22 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#23 | ACCEPTED | 0.01 s | 3, 4, 5 | details |
#24 | WRONG ANSWER | 0.02 s | 3, 4, 5 | details |
#25 | WRONG ANSWER | 0.03 s | 3, 4, 5 | details |
#26 | WRONG ANSWER | 0.02 s | 3, 4, 5 | details |
#27 | WRONG ANSWER | 0.01 s | 3, 4, 5 | details |
#28 | WRONG ANSWER | 0.02 s | 3, 4, 5 | details |
#29 | WRONG ANSWER | 0.01 s | 3, 4, 5 | details |
#30 | WRONG ANSWER | 0.02 s | 3, 4, 5 | details |
#31 | WRONG ANSWER | 0.02 s | 3, 4, 5 | details |
#32 | WRONG ANSWER | 0.01 s | 3, 4, 5 | details |
#33 | WRONG ANSWER | 0.02 s | 3, 4, 5 | details |
#34 | WRONG ANSWER | 0.01 s | 4, 5 | details |
#35 | WRONG ANSWER | 0.01 s | 4, 5 | details |
#36 | WRONG ANSWER | 0.02 s | 4, 5 | details |
#37 | WRONG ANSWER | 0.01 s | 4, 5 | details |
#38 | WRONG ANSWER | 0.02 s | 4, 5 | details |
#39 | WRONG ANSWER | 0.01 s | 4, 5 | details |
#40 | WRONG ANSWER | 0.02 s | 4, 5 | details |
#41 | WRONG ANSWER | 0.02 s | 4, 5 | details |
#42 | WRONG ANSWER | 0.02 s | 4, 5 | details |
#43 | WRONG ANSWER | 0.02 s | 4, 5 | details |
#44 | WRONG ANSWER | 0.02 s | 4, 5 | details |
#45 | WRONG ANSWER | 0.01 s | 4, 5 | details |
#46 | WRONG ANSWER | 0.05 s | 5 | details |
#47 | WRONG ANSWER | 0.05 s | 5 | details |
#48 | WRONG ANSWER | 0.07 s | 5 | details |
#49 | WRONG ANSWER | 0.07 s | 5 | details |
#50 | WRONG ANSWER | 0.08 s | 5 | details |
#51 | WRONG ANSWER | 0.05 s | 5 | details |
#52 | WRONG ANSWER | 0.06 s | 5 | details |
#53 | WRONG ANSWER | 0.07 s | 5 | details |
#54 | WRONG ANSWER | 0.07 s | 5 | details |
#55 | WRONG ANSWER | 0.07 s | 5 | details |
#56 | WRONG ANSWER | 0.06 s | 5 | details |
#57 | WRONG ANSWER | 0.07 s | 5 | details |
Code
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i=a; i<(b); i++) typedef long long ll; ll res; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int k, n; cin>>k>>n; vector<ll> arr; FOR(i,0,n) { char s1,s2; ll p1, p2; cin>>s1>>p1>>s2>>p2; if (s1 == s2) { res += abs(p1-p2); continue; } else res++; arr.push_back(p1); arr.push_back(p2); } sort(arr.begin(), arr.end()); if (arr.size() == 0) return cout<<res<<"\n", 0; ll r = arr[arr.size() / 2]; for (ll v : arr) res += abs(v - r); cout<<r<<"\n"; }
Test details
Test 1
Group: 1, 2
Verdict: ACCEPTED
input |
---|
1 1 B 457748887 B 796098674 |
correct output |
---|
338349787 |
user output |
---|
338349787 |
Test 2
Group: 1, 2
Verdict: ACCEPTED
input |
---|
1 4 B 90 B 72 A 68 A 90 A 15 A 42 A 45 A 15 |
correct output |
---|
97 |
user output |
---|
97 |
Test 3
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1 1000 A 0 B 1 A 1 B 0 A 0 B 1 B 0 A 0 ... |
correct output |
---|
1969 |
user output |
---|
1 |
Test 4
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1 1000 A 598380 B 85785 B 458027 A 842152 B 107714 A 39933 B 814225 A 328927 ... |
correct output |
---|
497512790 |
user output |
---|
491914 |
Test 5
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1 967 B 224488483 A 870079127 A 647780056 B 965306270 B 735321905 A 82275290 A 515414803 B 41707746 ... |
correct output |
---|
473798660797 |
user output |
---|
482510721 |
Test 6
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1 1000 A 1000000000 B 0 A 0 B 1000000000 B 0 A 1000000000 A 1000000000 B 0 ... |
correct output |
---|
1000000001000 |
user output |
---|
1000000000 |
Test 7
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1 1000 B 540773 A 324388 B 1033055 A 1254946 A 2804687 B 2012944 A 3827608 B 3200426 ... |
correct output |
---|
500006153353 |
user output |
---|
500109691 |
Test 8
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1 1000 A 1000000000 B 0 B 1 A 999999999 A 999999998 B 2 A 3 B 999999997 ... |
correct output |
---|
999999002000 |
user output |
---|
999999001 |
Test 9
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1 1000 B 306275120 A 306275122 A 526391763 B 526391756 B 152153706 A 152153714 B 275942345 A 275942351 ... |
correct output |
---|
499047189554 |
user output |
---|
505678032 |
Test 10
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1 1000 A 0 B 0 A 500000000 B 500000000 A 1000000000 B 1000000000 B 1000000000 A 1000000000 ... |
correct output |
---|
656000001000 |
user output |
---|
500000000 |
Test 11
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1 1000 A 500000001 B 500000000 B 499999999 A 499999998 B 1000000000 A 999999999 A 999999997 B 999999998 ... |
correct output |
---|
650999816318 |
user output |
---|
500000084 |
Test 12
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 100000 A 1 B 1 B 1 A 0 A 0 B 1 A 0 B 0 ... |
correct output |
---|
199742 |
user output |
---|
1 |
Test 13
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 100000 B 197201502 A 236725324 B 921493373 A 697882177 A 353914239 B 965797962 A 619173343 B 76946356 ... |
correct output |
---|
49896622370502 |
user output |
---|
500441717 |
Test 14
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 89829 A 5656 B 4153 A 5854 B 8220 A 1115 B 5226 A 2446 B 3407 ... |
correct output |
---|
448956640 |
user output |
---|
5002 |
Test 15
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 58906 B 262032447 A 615361070 B 110761024 A 66611392 A 720901527 B 757393905 A 602897217 B 978610640 ... |
correct output |
---|
29450986771481 |
user output |
---|
499801074 |
Test 16
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 100000 A 0 B 1000000000 B 1000000000 A 0 B 0 A 1000000000 A 1000000000 B 0 ... |
correct output |
---|
100000000100000 |
user output |
---|
1000000000 |
Test 17
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 100000 A 7461 B 9756 A 12548 B 14001 A 26302 B 21823 A 32953 B 37935 ... |
correct output |
---|
50000000610462 |
user output |
---|
500006690 |
Test 18
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 100000 B 0 A 1000000000 A 1 B 999999999 B 2 A 999999998 B 999999997 A 3 ... |
correct output |
---|
99990000200000 |
user output |
---|
999900001 |
Test 19
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 100000 B 400220047 A 400220048 A 14044122 B 14044122 A 45270242 B 45270245 B 994675758 A 994675758 ... |
correct output |
---|
50093795762125 |
user output |
---|
502191990 |
Test 20
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 100000 B 1000000000 A 1000000000 A 500000000 B 500000000 B 1000000000 A 1000000000 A 0 B 0 ... |
correct output |
---|
66718000100000 |
user output |
---|
500000000 |
Test 21
Group: 2
Verdict: WRONG ANSWER
input |
---|
1 100000 A 1 B 0 A 2 B 3 A 5 B 4 B 500000000 A 500000001 ... |
correct output |
---|
66771748924060 |
user output |
---|
500000776 |
Test 22
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
2 1 B 686779001 B 298011277 |
correct output |
---|
388767724 |
user output |
---|
388767724 |
Test 23
Group: 3, 4, 5
Verdict: ACCEPTED
input |
---|
2 4 B 85 B 16 A 88 A 72 A 13 A 8 B 5 B 68 |
correct output |
---|
153 |
user output |
---|
153 |
Test 24
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 100 B 1 A 1 B 1 A 1 B 0 A 1 B 0 A 1 ... |
correct output |
---|
135 |
user output |
---|
1 |
Test 25
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 100 A 80895559 B 504694055 A 550515244 B 637123084 A 824581457 B 293902519 A 65276676 B 906746170 ... |
correct output |
---|
39400461569 |
user output |
---|
549789481 |
Test 26
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 61 A 882469 B 477162 A 276781 B 782546 B 696587 A 81196 B 573379 A 354344 ... |
correct output |
---|
23533490 |
user output |
---|
477162 |
Test 27
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 24 B 246060972 B 745635077 A 805134171 A 471810707 B 252217199 B 377725124 B 793449133 B 882787637 ... |
correct output |
---|
7222227740 |
user output |
---|
471818033 |
Test 28
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 100 A 0 B 1000000000 B 1000000000 A 0 B 1000000000 A 0 B 1000000000 A 0 ... |
correct output |
---|
100000000100 |
user output |
---|
1000000000 |
Test 29
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 100 B 7277035 A 2363507 A 14481349 B 18074096 A 23772733 B 25361815 B 38014142 A 39221304 ... |
correct output |
---|
25052929066 |
user output |
---|
500069983 |
Test 30
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 100 A 0 B 1000000000 A 1 B 999999999 B 999999998 A 2 B 3 A 999999997 ... |
correct output |
---|
99999990200 |
user output |
---|
999999901 |
Test 31
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 100 B 229133622 A 229133615 A 286436586 B 286436582 A 177918170 B 177918177 A 928539152 B 928539147 ... |
correct output |
---|
25763506210 |
user output |
---|
499980719 |
Test 32
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 100 B 1000000000 A 1000000000 B 1000000000 A 1000000000 B 500000000 A 500000000 B 0 A 0 ... |
correct output |
---|
30000000100 |
user output |
---|
500000000 |
Test 33
Group: 3, 4, 5
Verdict: WRONG ANSWER
input |
---|
2 100 B 1 A 0 A 500000000 B 500000001 A 3 B 2 B 999999999 A 1000000000 ... |
correct output |
---|
30000000838 |
user output |
---|
500000028 |
Test 34
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 1000 B 1 A 0 A 0 B 0 B 1 B 1 B 1 A 1 ... |
correct output |
---|
1488 |
user output |
---|
0 |
Test 35
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 1000 A 55 B 99 A 49 B 36 B 56 A 43 B 30 A 21 ... |
correct output |
---|
40742 |
user output |
---|
51 |
Test 36
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 993 B 856945560 A 98103483 B 25758143 A 606399727 B 765461653 A 689513816 A 880180326 B 997125325 ... |
correct output |
---|
379585137648 |
user output |
---|
492494198 |
Test 37
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 328 A 0 B 0 B 0 A 1 B 1 A 1 A 1 B 1 ... |
correct output |
---|
475 |
user output |
---|
1 |
Test 38
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 543 A 84 B 67 B 8 A 52 A 71 B 4 A 37 B 4 ... |
correct output |
---|
20775 |
user output |
---|
48 |
Test 39
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 385 A 286133 B 305048 B 3019 A 211390 A 680205 B 943092 A 717521 B 2626 ... |
correct output |
---|
150638388 |
user output |
---|
468393 |
Test 40
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 1000 A 1000000000 B 0 B 0 A 1000000000 B 1000000000 A 0 B 0 A 1000000000 ... |
correct output |
---|
1000000001000 |
user output |
---|
1000000000 |
Test 41
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 1000 A 337683 B 154786 A 1080479 B 1653867 A 2096703 B 2014255 A 3269807 B 3378028 ... |
correct output |
---|
250005306826 |
user output |
---|
500580533 |
Test 42
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 1000 B 0 A 1000000000 A 1 B 999999999 A 2 B 999999998 B 999999997 A 3 ... |
correct output |
---|
999999002000 |
user output |
---|
999999001 |
Test 43
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 1000 B 487537672 A 487537682 A 702434952 B 702434943 A 924937477 B 924937478 A 438742511 B 438742503 ... |
correct output |
---|
248460366924 |
user output |
---|
492228104 |
Test 44
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 1000 B 500000000 A 500000000 A 0 B 0 B 0 A 0 A 1000000000 B 1000000000 ... |
correct output |
---|
323000001000 |
user output |
---|
500000000 |
Test 45
Group: 4, 5
Verdict: WRONG ANSWER
input |
---|
2 1000 B 0 A 1 A 500000001 B 500000000 A 500000003 B 500000002 A 499999996 B 499999997 ... |
correct output |
---|
328999889746 |
user output |
---|
500000006 |
Test 46
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 A 1 B 0 A 0 B 1 A 1 B 1 B 0 A 0 ... |
correct output |
---|
150253 |
user output |
---|
1 |
Test 47
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 A 57 B 62 A 81 B 84 A 29 B 62 B 84 A 93 ... |
correct output |
---|
4054233 |
user output |
---|
50 |
Test 48
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 B 376633 A 401436 B 929991 A 301184 A 594140 B 788956 A 269074 B 579617 ... |
correct output |
---|
39017925999 |
user output |
---|
500899 |
Test 49
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 B 957291126 A 804724561 B 643453098 A 837804172 A 968031915 B 244064467 B 806058719 A 777366893 ... |
correct output |
---|
39023916424909 |
user output |
---|
500422285 |
Test 50
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 A 765748723 B 736102973 B 30767265 A 892885151 A 438782247 B 603304522 B 556204289 A 731709903 ... |
correct output |
---|
39003712943872 |
user output |
---|
500819811 |
Test 51
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 52924 B 214946095 A 74195083 B 144150299 A 848919272 A 632662655 B 429803598 B 132419689 A 911407267 ... |
correct output |
---|
20674441803953 |
user output |
---|
499551899 |
Test 52
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 B 1000000000 A 0 B 0 A 1000000000 B 1000000000 A 0 A 0 B 1000000000 ... |
correct output |
---|
100000000100000 |
user output |
---|
1000000000 |
Test 53
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 A 9838 B 2205 A 15278 B 17118 A 25088 B 22794 B 31319 A 39536 ... |
correct output |
---|
25000001294215 |
user output |
---|
500000738 |
Test 54
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 A 0 B 1000000000 A 1 B 999999999 A 2 B 999999998 A 999999997 B 3 ... |
correct output |
---|
99990000200000 |
user output |
---|
999900001 |
Test 55
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 B 69772706 A 69772713 A 701457803 B 701457802 B 526650518 A 526650528 B 44276587 A 44276586 ... |
correct output |
---|
25049824938170 |
user output |
---|
499307743 |
Test 56
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 A 0 B 0 A 500000000 B 500000000 B 0 A 0 A 0 B 0 ... |
correct output |
---|
33071000100000 |
user output |
---|
500000000 |
Test 57
Group: 5
Verdict: WRONG ANSWER
input |
---|
2 100000 B 999999999 A 1000000000 A 0 B 1 B 500000001 A 500000000 B 2 A 3 ... |
correct output |
---|
33278897746546 |
user output |
---|
500000378 |