QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#622059 | #8867. Equal Schedules | deepthought | AC ✓ | 1ms | 3876kb | C++23 | 985b | 2024-10-08 19:42:17 | 2024-10-08 19:42:18 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
map <string, int> m;
string s;
int a, b;
while(getline(cin, s)) {
if(s[0] == '-') break;
istringstream iss(s);
iss >> a >> b >> s;
m[s] += b - a;
}
while(getline(cin, s)) {
if(s[0] == '=') break;
istringstream iss(s);
iss >> a >> b >> s;
m[s] += a - b;
}
vector <pair <string, int>> ans;
for(auto x: m) {
string key = x.first;
int value = x.second;
if(value == 0) continue;
ans.push_back({key, -value});
}
sort(ans.begin(), ans.end());
int n = ans.size();
if(n == 0) {
cout << "No differences found." << endl;
return 0;
}
for(int i = 0; i < n; i++) {
char ch = '+';
int value = ans[i].second;
if(value < 0) ch = '-';
cout << ans[i].first << " " << ch << abs(value) << endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
0 10 ascjrnta 10 12 ccwhnqsy 12 13 cbjzdlog 13 17 kwwlgnap 17 27 ltzygyrb 27 29 xadlwdgc 29 30 esdgzclx 30 32 sjkdwzuo 32 33 gxdjzslk 33 35 hrvpgomd 35 39 pautbpeo 39 41 lhgnhart 41 80 uizeymjb 80 82 bnrsifxe 82 84 spyjcqvx 84 88 ntrrpdxw 88 94 spyjcqvx 94 96 ltzygyrb 96 99 qkdoxehn 99 100 ailhqfmc ...
output:
ailhqfmc -1 ascjrnta -10 bnrsifxe -2 cbjzdlog -1 ccwhnqsy -2 esdgzclx -1 gxdjzslk -1 hrvpgomd +1 kwwlgnap -4 lhgnhart -2 ltzygyrb -12 ntrrpdxw -4 pautbpeo -4 qkdoxehn -3 sjkdwzuo -2 spyjcqvx -8 uizeymjb -39 xadlwdgc -2
result:
ok 18 lines
Test #2:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
0 1 uwcpgpev ------ 0 3 vhzrzghb 3 4 szbdshpx 4 5 efykjzzp 5 6 vhzrzghb 6 17 eilclkac 17 18 dokhuczg 18 19 olyyoldk 19 39 ybocaqsf 39 40 uyumuhfu 40 41 qzpgygoi 41 76 uyumuhfu 76 78 desdcopv 78 84 hdqrufqt 84 87 jctgcbkd 87 88 ybocaqsf 88 93 yddvijpk 93 98 efshexit 98 99 efshexit ======
output:
desdcopv +2 dokhuczg +1 efshexit +6 efykjzzp +1 eilclkac +11 hdqrufqt +6 jctgcbkd +3 olyyoldk +1 qzpgygoi +1 szbdshpx +1 uwcpgpev -1 uyumuhfu +36 vhzrzghb +4 ybocaqsf +21 yddvijpk +5
result:
ok 15 lines
Test #3:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
0 24 qkjplqct 24 25 qaewzkvk 25 36 kcsauxgr 36 38 xpetdbvp 38 54 fwixxotq 54 56 pgntdhrm 56 76 qlpfvint 76 81 wvwgbnxv 81 92 ctkycspy 92 93 saucoirf 93 97 hfmezlsl 97 122 jwljamvo 122 173 tylmachc 173 184 bhahthif 184 260 gffkwute 260 280 slvclttm 280 281 pfkkiigg 281 294 eolminre 294 295 pqqhizlf 2...
output:
aaanqtng +2 afzooncd +22 akxydmev -8 alorcodc +2 aranpnza +3 asvnopmh +10 auzspkto -5 bewnplsn +28 bhahthif -11 bmsiebng -18 bojbgjgg -2 boniqmsi -2 brnggxvl -1 bvoddbru -8 cftwzmjo +2 csqguupx +3 ctkycspy -11 cyafzhny +27 dclwjmbm -22 ddhfavgd +13 dispqbyl +3 dkztvqiq +11 dmepzsjl +93 dmrncxuw +19 ...
result:
ok 141 lines
Test #4:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
0 6 lgttufjw 6 37 cvuxgpjh 37 39 bnvcutnt 39 40 utrpldwj 40 43 crnwkbte 43 85 dnrfmmrf 85 86 tlpkomsy 86 95 aeukrzwy 95 96 wlvgxaib 96 108 zrnfudiq 108 111 usxbyxer 111 134 dgmpqcvk 134 141 yonigkyo 141 148 crnwkbte 148 155 opblcyxx 155 178 prhzsdtb 178 182 jlqglecb 182 190 pxletigz 190 193 pukgoevj...
output:
aeukrzwy -3 ahrmjrqc +25 ahzikjpy -14 aillnlug -33 audbwess +2 axvimzgv +1 aztsnhtn +11 bkzhkqfh -6 bnvcutnt -88 bsszhpke +5 bujaggzn +6 cbbpxrxx +7 cdpxlstv +34 cfoazwot +9 cnjsrdku -16 crnwkbte -50 crpfxvir +19 cucfalij +1 cvuxgpjh -31 dckvasny -21 dejeoero +2 dgmpqcvk -23 dmrjfaqz +36 dmvllwkx -7...
result:
ok 151 lines
Test #5:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
0 11 feupzvml 11 12 hegftsme 12 22 ggyzwkfk 22 30 muhppcbh 30 31 kewbthnp 31 32 ikqjccxa 32 33 houxrsus 33 45 fzcuwgcg 45 81 anjbfhxf 81 87 mpvowsbu 87 95 bedzmfdq 95 96 otsnljjt 96 97 vxvtswjp 97 101 genphjuz 101 102 ftyncqya 102 241 yxxmwxgj 241 244 cgngqupo 244 252 vcxempvu 252 253 qfirgalh 253 2...
output:
afliwavh +6 ajwlwrxl -3 anjbfhxf -36 aodyyjmp +21 atonsent +1 awrohiem +1 bbgxtfdq +1 bbhsgdvu -4 bblvnaos -1 bedzmfdq -8 bejamxhg +1 bkgnmvvf +2 brtvymgb +1 cauhsdkk -8 cgngqupo -3 chibbntc +15 chpxsctd -5 cjgqoqug -65 cmagksef +164 cmicxfid +6 cmjfysih +31 cpsjfzoq -19 cqnbfwdi +1 ctgkqela +1 dddg...
result:
ok 177 lines
Test #6:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
0 14 haxmhvsdqkwpbjowghnf 14 18 vvcuxncwfergpspjrejq 18 22 hevsnknmxumatalkzniv 22 23 evjfrfqtiozflgvdoyju 23 24 vvcuxncwfergpspjrejq 24 25 xtsqgtbcriiwjwubdruq 25 40 evjfrfqtiozflgvdoyju 40 68 xtsqgtbcriiwjwubdruq 68 72 hhkgyitcmshccxdmrosc 72 75 nhjlezboelkownxmzpmh 75 78 hhkgyitcmshccxdmrosc 78 8...
output:
cbusqgisddxfrapwklac +155 ctnlhaqijplxehjhqrrb -21 evjfrfqtiozflgvdoyju -83 haxmhvsdqkwpbjowghnf -9 hevsnknmxumatalkzniv +4 hhkgyitcmshccxdmrosc -10 jfbaofkowunpqftttxmo +16 nhjlezboelkownxmzpmh +46 vvcuxncwfergpspjrejq -16 xtsqgtbcriiwjwubdruq -82
result:
ok 10 lines
Test #7:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
0 10 mjroxyxq 10 20 cxytgoej 20 30 nqzcpjif 30 40 rejmrzug 40 50 skdjbefp 50 60 sfijaswe 60 70 eyevqvfp 70 80 bbicptyf 80 90 lnqfshto 90 100 djvxhvgp 100 110 zjdvswpx 110 120 ewkvtrdh 120 130 afshnrwy 130 140 wdxtxhsj 140 150 mlsnrusi 150 160 ewkvtrdh 160 170 zxqvpesk 170 180 mbmgcqpo 180 190 ufqoaz...
output:
No differences found.
result:
ok single line: 'No differences found.'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
0 1 smdsbxuk 1 2 megyiftu 2 3 smdsbxuk 3 4 ckylgypq 4 5 iwmatjmk 5 6 ckwaoskb 6 7 megyiftu 7 8 haanerbc 8 9 haanerbc 9 10 megyiftu 10 11 mgqcuuef 11 12 iwmatjmk 12 13 smdsbxuk 13 14 ckwaoskb 14 15 mgqcuuef 15 16 haanerbc 16 17 mgqcuuef 17 18 hhzltdai 18 19 smdsbxuk 19 20 haanerbc 20 21 hhzltdai 21 2...
output:
No differences found.
result:
ok single line: 'No differences found.'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3680kb
input:
0 1 rwiwfqla 1 2 rwiwfqla 2 3 rwiwfqla 3 4 rwiwfqla 4 5 rwiwfqla 5 6 rwiwfqla 6 7 rwiwfqla 7 8 rwiwfqla 8 9 rwiwfqla 9 10 rwiwfqla 10 11 rwiwfqla 11 12 rwiwfqla 12 13 rwiwfqla 13 14 rwiwfqla 14 15 rwiwfqla 15 16 rwiwfqla 16 17 rwiwfqla 17 18 rwiwfqla 18 19 rwiwfqla 19 20 rwiwfqla 20 21 rwiwfqla 21 2...
output:
No differences found.
result:
ok single line: 'No differences found.'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3876kb
input:
0 3 knzxtjdt 3 10 mgmofdpd ------ 0 1 mgmofdpd 1 2 kzrwszim 2 4 knzxtjdt 4 8 kzrwszim 8 10 xbywnujm ======
output:
knzxtjdt -1 kzrwszim +5 mgmofdpd -6 xbywnujm +2
result:
ok 4 lines
Test #11:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
0 3 hwjpzoxj 3 4 vmwxpkux 4 5 vmwxpkux 5 6 ihgactaj 6 7 ihgactaj 7 8 hwjpzoxj 8 9 uvcmiijg 9 10 ihgactaj ------ 0 3 vmwxpkux 3 5 ihgactaj 5 6 hwjpzoxj 6 10 hwjpzoxj ======
output:
hwjpzoxj +1 ihgactaj -1 uvcmiijg -1 vmwxpkux +1
result:
ok 4 lines
Test #12:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
0 1 ihncxdms 1 5 ihncxdms 5 7 igmbsgub 7 10 bchgxoag ------ 0 1 yxmcwmyz 1 3 newnnicx 3 4 newnnicx 4 5 ihncxdms 5 6 yxmcwmyz 6 7 ihncxdms 7 8 newnnicx 8 9 ihncxdms 9 10 newnnicx ======
output:
bchgxoag -3 igmbsgub -2 ihncxdms -2 newnnicx +5 yxmcwmyz +2
result:
ok 5 lines
Test #13:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
0 1 mroqtalz 1 3 tdsjbetj 3 10 glbqjbjb ------ 0 1 mroqtalz 1 2 tdsjbetj 2 10 xsedlcql ======
output:
glbqjbjb -7 tdsjbetj -1 xsedlcql +8
result:
ok 3 lines
Test #14:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
0 3 fdejoyug 3 9 qfcwiqtd 9 10 qfcwiqtd ------ 0 2 xwxlkskb 2 4 fdejoyug 4 10 tvqdeipf ======
output:
fdejoyug -1 qfcwiqtd -7 tvqdeipf +6 xwxlkskb +2
result:
ok 4 lines
Test #15:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
0 1 ogcpsnou 1 4 ogcpsnou 4 5 rzcbkjwr 5 6 rzcbkjwr 6 10 tsjppekj 10 12 dbykqyve 12 13 rzcbkjwr 13 16 swjkruhn ------ 0 1 ogcpsnou 1 2 dbykqyve 2 4 rzcbkjwr 4 5 rzcbkjwr 5 8 swjkruhn 8 9 tsjppekj 9 10 dbykqyve 10 13 ogcpsnou 13 16 tsjppekj ======
output:
No differences found.
result:
ok single line: 'No differences found.'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
0 1 dmdqnqno 1 4 qxfbeevc 4 8 kjmjdexy 8 10 jxbrhuvb 10 13 rnywtcef 13 16 dmdqnqno 16 17 jxbrhuvb ------ 0 3 rnywtcef 3 5 dmdqnqno 5 8 jxbrhuvb 8 10 dmdqnqno 10 13 qxfbeevc 13 17 kjmjdexy ======
output:
No differences found.
result:
ok single line: 'No differences found.'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
0 1 lnejunsb 1 2 efieocpo 2 5 zxcihjfd 5 6 fwunrlgb 6 8 efieocpo 8 10 zxcihjfd 10 11 fwunrlgb 11 17 zcafmjpx ------ 0 2 fwunrlgb 2 3 efieocpo 3 4 zxcihjfd 4 10 zcafmjpx 10 12 efieocpo 12 16 zxcihjfd 16 17 lnejunsb ======
output:
No differences found.
result:
ok single line: 'No differences found.'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
0 1 adiohyop 1 3 adiohyop 3 6 imaqnsjn 6 9 imaqnsjn 9 10 adiohyop 10 15 nxgcknnf 15 18 tmblnjjv ------ 0 2 imaqnsjn 2 3 nxgcknnf 3 5 nxgcknnf 5 8 tmblnjjv 8 10 nxgcknnf 10 14 imaqnsjn 14 18 adiohyop ======
output:
No differences found.
result:
ok single line: 'No differences found.'
Test #19:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
0 1 fkkgusxa 1 2 hteachus 2 3 esacyrte 3 4 hteachus 4 6 vpizdlxc 6 8 esacyrte 8 10 hteachus 10 12 xdhinaqe 12 16 fkkgusxa ------ 0 2 esacyrte 2 4 xdhinaqe 4 5 hteachus 5 10 fkkgusxa 10 11 esacyrte 11 14 hteachus 14 16 vpizdlxc ======
output:
No differences found.
result:
ok single line: 'No differences found.'
Extra Test:
score: 0
Extra Test Passed