QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#664020 | #7154. Inflation | blackslex# | 0 | 268ms | 24540kb | C++14 | 538b | 2024-10-21 18:58:10 | 2024-10-21 18:58:11 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 3e5 + 5;
int n, q, x, y, z;
ll ans;
char s[15];
map<ll, int> cnt;
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%d", &x), ans += x, cnt[x]++;
scanf("%d", &q);
while (q--) {
scanf("%s %d", &s, &x);
if (s[0] == 'S') {
scanf("%d", &y);
ans += 1LL * (y - x) * cnt[x];
cnt[y] += cnt[x]; cnt[x] = 0;
}
printf("%lld\n", ans);
}
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3948kb
input:
1 23 100 INFLATION 65 INFLATION 37 INFLATION 28 INFLATION 41 INFLATION 53 INFLATION 46 SET 81 22 INFLATION 91 SET 45 85 SET 85 14 INFLATION 58 INFLATION 89 SET 98 60 INFLATION 75 INFLATION 97 SET 91 53 INFLATION 31 INFLATION 51 SET 81 78 SET 16 78 INFLATION 59 SET 10 74 INFLATION 55 SET 7 50 INFLATI...
output:
23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23
result:
wrong answer 1st numbers differ - expected: '88', found: '23'
Subtask #2:
score: 0
Wrong Answer
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 3752kb
input:
1 23 100 INFLATION 65 INFLATION 37 INFLATION 28 INFLATION 41 INFLATION 53 INFLATION 46 SET 81 22 INFLATION 91 SET 45 85 SET 85 14 INFLATION 58 INFLATION 89 SET 98 60 INFLATION 75 INFLATION 97 SET 91 53 INFLATION 31 INFLATION 51 SET 81 78 SET 16 78 INFLATION 59 SET 10 74 INFLATION 55 SET 7 50 INFLATI...
output:
23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23
result:
wrong answer 1st numbers differ - expected: '88', found: '23'
Subtask #3:
score: 0
Wrong Answer
Test #22:
score: 0
Wrong Answer
time: 150ms
memory: 20160kb
input:
300000 951351 399077 631051 774844 106866 983747 985797 551211 280105 755685 239394 499384 426078 235060 496603 342116 956581 934742 542102 616510 709067 207632 690607 166356 733456 276205 265791 82499 190425 231230 882006 759975 728793 539410 543318 537385 857482 886000 862880 438199 937944 615644 ...
output:
150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 150127839146 1...
result:
wrong answer 1st numbers differ - expected: '392965539146', found: '150127839146'
Subtask #4:
score: 0
Wrong Answer
Test #28:
score: 23
Accepted
time: 268ms
memory: 24540kb
input:
300000 947318 850376 902969 604347 67162 326934 983509 617741 797556 532417 364000 987510 494945 673154 690612 243955 959719 909872 189543 627965 826065 586321 119252 290670 655680 527058 254003 559766 354780 659156 812403 214395 771905 87515 353059 677708 142575 286504 122078 61221 239279 348056 55...
output:
149924407594 149924615188 149924944998 149925055079 149925309448 149925635931 149924937354 149926708428 149926581048 149925907778 149925775725 149926373725 149927119925 149927710243 149927711044 149927433676 149926621498 149927345952 149927002016 149926546713 149926126855 149926725608 149925922690 1...
result:
ok 100000 numbers
Test #29:
score: 23
Accepted
time: 106ms
memory: 9784kb
input:
300000 478 672 460 72 104 725 496 48 691 976 56 750 217 185 253 159 309 622 704 500 404 866 217 531 893 689 110 991 823 906 590 275 304 529 742 96 535 153 563 37 975 833 1000 103 370 31 564 494 75 325 241 744 969 409 36 481 755 670 24 771 802 119 417 596 510 415 639 977 522 635 728 64 988 465 607 98...
output:
177285256 203836816 279508258 477933633 715380377 811709087 824157287 1031443405 1117309237 1298472941 1552663841 1752388097 1951598199 2163461499 2315113375 2349293815 2628955278 2840030958 2862597888 3127971546 3407359866 3500116026 3511124858 3618887654 3730267949 3924481821 3811370188 3969513814...
result:
ok 100000 numbers
Test #30:
score: 23
Accepted
time: 97ms
memory: 9812kb
input:
300000 44 88 93 95 2 7 31 70 93 32 16 53 10 88 100 12 83 42 91 68 1 55 39 38 41 42 94 50 63 90 70 91 93 93 56 38 12 70 50 68 33 39 12 32 14 37 29 48 5 23 65 98 20 46 72 23 36 42 52 60 85 52 83 17 15 69 51 83 73 51 49 27 82 51 16 11 38 55 89 9 65 44 68 9 52 29 10 24 80 42 27 62 76 47 70 92 22 2 43 66...
output:
2874959706 5652817932 7626473952 9990929386 12051477535 12819396655 13903440544 13900308314 16818352634 17297512994 17297512994 19314885346 20414602146 21585980546 23262249266 24465102218 26866392857 24605827577 26515278023 28065559399 27812627584 27812627584 27852179740 29531811682 31118941339 3275...
result:
ok 100000 numbers
Test #31:
score: 23
Accepted
time: 97ms
memory: 9732kb
input:
300000 2 4 1 1 9 4 9 2 8 4 6 3 8 6 1 9 9 4 9 1 4 5 10 6 4 5 2 6 4 3 8 4 4 8 8 6 10 10 2 5 8 6 6 5 3 10 4 1 6 5 6 10 2 7 7 6 8 8 9 8 6 4 4 5 8 9 4 10 5 3 2 3 2 7 7 9 8 3 7 9 5 3 5 4 9 1 8 5 9 3 6 8 3 1 7 8 7 8 9 9 1 6 5 8 8 5 4 7 2 5 1 4 10 7 3 4 5 10 9 1 4 3 5 1 3 1 3 9 6 3 9 1 5 8 3 3 9 9 1 5 6 4 3...
output:
11804211819 11804211819 29108160068 56522901968 61152469458 61152469458 61152469458 61152469458 61152469458 61152469458 61152469458 61152469458 61152469458 61152469458 84553824714 84553824714 107845381266 105142893016 105142893016 99090774216 99090774216 117107611466 117107611466 117107611466 125620...
result:
ok 100000 numbers
Test #32:
score: 23
Accepted
time: 95ms
memory: 9800kb
input:
300000 1 1 2 1 2 1 1 2 2 1 2 1 2 2 1 2 1 2 1 2 1 2 2 1 2 1 1 1 1 1 2 1 2 2 1 1 2 2 2 2 1 1 1 1 2 2 1 1 2 1 2 1 1 1 2 2 1 2 2 2 1 2 1 2 2 2 2 1 2 1 2 1 2 1 1 1 1 1 2 2 1 1 2 2 1 1 2 2 1 2 2 2 2 2 2 1 2 1 2 2 1 1 2 1 1 2 2 1 2 2 1 1 1 2 1 2 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 2 2 1 1 1 2 2 1 1 1 2 1 1...
output:
56887533920 56887533920 118384554000 118384554000 199757013500 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173107500940 173...
result:
ok 100000 numbers
Test #33:
score: 23
Accepted
time: 213ms
memory: 20068kb
input:
300000 998888 864124 702620 207922 685995 940811 617247 398305 51624 276606 48079 16144 286823 695985 881608 803383 357584 514663 700225 405846 519570 875885 538808 921253 21037 426714 259557 52008 91248 508858 465403 557294 144250 570793 242334 22226 710618 381583 893055 647553 466759 291291 337029...
output:
150230640881 150231065315 150230938289 150231297227 150227853108 150227163876 150227496846 150225819434 150224630038 150223036222 150230539784 150230094467 150230156597 150238566194 150238536137 150239976259 150240807258 150228590208 150229012204 150233476465 150225730125 150224423599 150224022654 1...
result:
ok 100000 numbers
Test #34:
score: 0
Wrong Answer
time: 154ms
memory: 10228kb
input:
300000 45300 22176 106360 14097 75860 97151 8274 70277 39913 17453 72093 47950 5898 26496 69310 5692 63125 100092 96223 75593 65769 5277 50523 9906 18377 43087 107612 86038 28693 75379 21124 66315 56379 56065 82768 106634 31717 88408 19077 96627 59089 110709 17025 29843 70923 35747 12941 23941 344 2...
output:
16640405689 16640360873 16640186793 16640157817 16639943465 16639885163 16640864888 16641172118 16641048110 16640970666 16640805450 16642465129 16642424281 16637416603 16637412223 16637130040 16636944163 16640997331 16637433691 16638524194 16638407329 16638307989 16638105675 16644620486 16644875318 ...
result:
wrong answer 13570th numbers differ - expected: '17997990665', found: '17917557557'
Subtask #5:
score: 0
Wrong Answer
Test #37:
score: 0
Wrong Answer
time: 0ms
memory: 3752kb
input:
1 23 100 INFLATION 65 INFLATION 37 INFLATION 28 INFLATION 41 INFLATION 53 INFLATION 46 SET 81 22 INFLATION 91 SET 45 85 SET 85 14 INFLATION 58 INFLATION 89 SET 98 60 INFLATION 75 INFLATION 97 SET 91 53 INFLATION 31 INFLATION 51 SET 81 78 SET 16 78 INFLATION 59 SET 10 74 INFLATION 55 SET 7 50 INFLATI...
output:
23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23
result:
wrong answer 1st numbers differ - expected: '88', found: '23'