QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#49550#2281. BnPCkrystofmitkaWA 181ms28416kbC++3.8kb2022-09-21 22:31:152022-09-21 22:31:18

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-09-21 22:31:18]
  • 评测
  • 测评结果:WA
  • 用时:181ms
  • 内存:28416kb
  • [2022-09-21 22:31:15]
  • 提交

answer

#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <list>
#include <cassert>
#include <climits>
#include <bitset>
#include <chrono>
#include <random>
#include <functional>
#include <unordered_map>
#include <unordered_set>

using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

typedef long long ll;

#define O(i) i & 1
#define E(i) !O(i)
#define SZ(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n) FORE(i,0,n)
#define FORSZ(i,a,v) FOR(i,a,SZ(v))
#define REPSZ(i,v) REP(i,SZ(v))

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll n; cin >> n;
    ll k; cin >> k;
    unordered_map<string, ll> current;
    unordered_map<string, vector<ll>> maxFreq;
    while (n--) {
        string a; cin >> a;
        ll s; cin >> s;
        current[a] = s;
        maxFreq[a] = vector<ll>(3, 0);
    }

    ll l; cin >> l;
    ll highestFreq = 0;
    vector<pair<string, ll>> thingies;
    while(l--) {
        string a; cin >> a;
        ll t; cin >> t;
        thingies.emplace_back(a,t);

        maxFreq[a][0] = max(maxFreq[a][0], t);
        maxFreq[a][1]++;
        if (maxFreq[a][1] > highestFreq) {
            highestFreq = maxFreq[a][1];
        }
    }

    ll ans = 0;
    // calculate if possible to make all levels with k and update attributes
    for ( const auto &p : current ) {
        if (p.second < maxFreq[p.first][0]) {
            k = k + (p.second - maxFreq[p.first][0]);
            current[p.first] = maxFreq[p.first][0];
        }
        if (k < 0) {
            cout << '0' << '\n';
            return 0;
        }
    }

    // add up all the points gained by leveling up all attributes to pass
    for ( const auto &p : thingies ) {
        if (current[p.first] == p.second) {
            maxFreq[p.first][2]++;
        } else {
            ans = ans + current[p.first];
        }
    }


    priority_queue<ll> q;
    for ( const auto &p : current ) {
        ll newAttributeGain = p.second + 1;
        ll possiblePointsGained = newAttributeGain*maxFreq[p.first][2] + (maxFreq[p.first][1] - maxFreq[p.first][2]);
        if (possiblePointsGained > highestFreq) {
            q.push(possiblePointsGained);
        }
    }

    while (k >= 0 && !q.empty()) {
        ans = ans + q.top();
        q.pop();
        k--;
    }

    cout << ans + k*highestFreq << '\n';

    return 0;
}



Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3540kb

input:

3 14
THISISTHEONE 8
B 0
C 0
8
THISISTHEONE 10
C 0
B 1
B 0
THISISTHEONE 0
C 1
THISISTHEONE 0
THISISTHEONE 0

output:

82

result:

ok single line: '82'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

3 99
THEFIRSTINCREASE 6
SECONDINCREASE 4
ZZZ 1
9
THEFIRSTINCREASE 4
ZZZ 0
THEFIRSTINCREASE 6
SECONDINCREASE 8
THEFIRSTINCREASE 2
SECONDINCREASE 1
ZZZ 0
SECONDINCREASE 8
THEFIRSTINCREASE 3

output:

429

result:

ok single line: '429'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

5 20
A 100
B 200
C 300
D 400
E 500
949
A 39
A 23
C 163
A 98
B 36
A 3
A 52
B 152
B 167
B 65
C 142
B 66
B 117
C 288
C 155
E 341
A 97
D 173
E 31
A 62
D 90
E 361
A 42
D 85
E 1
C 141
B 77
B 194
D 221
E 203
D 345
E 48
B 26
D 46
B 74
E 380
B 181
C 243
B 112
A 99
E 403
C 20
E 453
C 149
B 26
E 245
A 74
D 304...

output:

285180

result:

ok single line: '285180'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3544kb

input:

2 1
A 10
B 12
3
A 10
B 10
B 10

output:

35

result:

ok single line: '35'

Test #5:

score: 0
Accepted
time: 2ms
memory: 3652kb

input:

1 1
OVERENTHUSIASTICNESS 41
1
OVERENTHUSIASTICNESS 0

output:

42

result:

ok single line: '42'

Test #6:

score: 0
Accepted
time: 181ms
memory: 28396kb

input:

100000 1000000000
A 1000000000
B 1000000000
C 1000000000
D 1000000000
E 1000000000
F 1000000000
G 1000000000
H 1000000000
I 1000000000
J 1000000000
K 1000000000
L 1000000000
M 1000000000
N 1000000000
O 1000000000
P 1000000000
Q 1000000000
R 1000000000
S 1000000000
T 1000000000
U 1000000000
V 1000000...

output:

100007999593560

result:

ok single line: '100007999593560'

Test #7:

score: 0
Accepted
time: 172ms
memory: 28416kb

input:

100000 1000000000
A 1000000000
B 1000000000
C 1000000000
D 1000000000
E 1000000000
F 1000000000
G 1000000000
H 1000000000
I 1000000000
J 1000000000
K 1000000000
L 1000000000
M 1000000000
N 1000000000
O 1000000000
P 1000000000
Q 1000000000
R 1000000000
S 1000000000
T 1000000000
U 1000000000
V 1000000...

output:

100006999854911

result:

ok single line: '100006999854911'

Test #8:

score: 0
Accepted
time: 22ms
memory: 8424kb

input:

1 1000000000
A 1000000000
100000
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0
A 0...

output:

200000000000000

result:

ok single line: '200000000000000'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3696kb

input:

1 1
A 0
1
A 0

output:

1

result:

ok single line: '1'

Test #10:

score: 0
Accepted
time: 2ms
memory: 3636kb

input:

1 800000
A 0
1000
A 0
A 1
A 2
A 3
A 4
A 5
A 6
A 7
A 8
A 9
A 10
A 11
A 12
A 13
A 14
A 15
A 16
A 17
A 18
A 19
A 20
A 21
A 22
A 23
A 24
A 25
A 26
A 27
A 28
A 29
A 30
A 31
A 32
A 33
A 34
A 35
A 36
A 37
A 38
A 39
A 40
A 41
A 42
A 43
A 44
A 45
A 46
A 47
A 48
A 49
A 50
A 51
A 52
A 53
A 54
A 55
A 56
A 57
A ...

output:

800000000

result:

ok single line: '800000000'

Test #11:

score: 0
Accepted
time: 7ms
memory: 8508kb

input:

2 1000000000
B 235
A 1000000000
100000
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A 1
A...

output:

200000000000000

result:

ok single line: '200000000000000'

Test #12:

score: 0
Accepted
time: 54ms
memory: 16044kb

input:

50457 435832308
A 192207613
B 218291430
C 72712030
D 8339557
E 233611631
F 924985735
G 707429015
H 495523396
I 1524253
J 940348426
K 191972642
L 421286578
M 162847048
N 280111507
O 601044189
P 929639718
Q 893573186
R 920586936
S 56283573
T 46461264
U 4612777
V 221232991
W 968811350
X 783669701
Y 667...

output:

0

result:

ok single line: '0'

Test #13:

score: 0
Accepted
time: 2ms
memory: 4248kb

input:

2836 44662413
A 269836858
B 972857889
C 51515364
D 328683395
E 526234284
F 689725572
G 769138643
H 790617490
I 48093964
J 243168110
K 180077017
L 623293643
M 981360167
N 645396090
O 412624316
P 709387419
Q 322883776
R 553162583
S 216235922
T 209753908
U 528154246
V 451750020
W 300516519
X 572996665
...

output:

0

result:

ok single line: '0'

Test #14:

score: 0
Accepted
time: 2ms
memory: 3624kb

input:

465 720708570
A 964489218
B 152054233
C 552095349
D 209903032
E 926041026
F 973820240
G 417242347
H 652805464
I 774473005
J 868230713
K 721131727
L 627241636
M 623019960
N 809095709
O 928690803
P 229390175
Q 595062361
R 273163306
S 798525471
T 972932324
U 333873971
V 927559188
W 926041190
X 64539094...

output:

0

result:

ok single line: '0'

Test #15:

score: 0
Accepted
time: 16ms
memory: 6584kb

input:

2658 922279939
A 179440353
B 624882483
C 104338141
D 130390676
E 328696385
F 669528812
G 938956597
H 134386530
I 854249965
J 282808688
K 695715582
L 326559726
M 707578888
N 290880040
O 20090871
P 896530690
Q 236292479
R 782324722
S 233253660
T 916440565
U 285886536
V 430491333
W 48525799
X 868428462...

output:

0

result:

ok single line: '0'

Test #16:

score: 0
Accepted
time: 2ms
memory: 3544kb

input:

8 274740128
A 787142485
B 216348350
C 116587980
D 963101420
E 296609285
F 76881088
G 324055267
H 97255786
4
D 278467507
G 929361476
A 103818943
D 335313499

output:

0

result:

ok single line: '0'

Test #17:

score: 0
Accepted
time: 20ms
memory: 6100kb

input:

355 325155415
A 44833348
B 871233156
C 31992384
D 149027764
E 941973900
F 913862251
G 836954440
H 165707546
I 703453203
J 238029892
K 936849814
L 951092717
M 621542577
N 135251097
O 526232560
P 154173639
Q 812248178
R 360837673
S 29361628
T 912681470
U 848101041
V 790156523
W 543481112
X 227403881
Y...

output:

0

result:

ok single line: '0'

Test #18:

score: 0
Accepted
time: 3ms
memory: 3940kb

input:

516 876102983
A 68079588
B 607865472
C 586115560
D 834251151
E 87957637
F 962496410
G 836754794
H 830728526
I 643131807
J 75363697
K 110415934
L 606888382
M 513209012
N 872632048
O 782613088
P 285301268
Q 376901180
R 675751665
S 216874851
T 517125466
U 301946024
V 435754958
W 466322875
X 633407709
Y...

output:

0

result:

ok single line: '0'

Test #19:

score: 0
Accepted
time: 3ms
memory: 3616kb

input:

6 690409537
A 548663356
B 706017338
C 306741866
D 951661376
E 383836924
F 709600248
1702
C 324469538
C 991088537
B 779024449
D 550683338
A 817153008
E 504793649
E 595511588
F 776506465
B 221367140
D 922156232
A 22456728
B 729727714
A 501225234
F 315280769
D 76402244
A 774494518
E 33765301
C 26334577...

output:

0

result:

ok single line: '0'

Test #20:

score: 0
Accepted
time: 49ms
memory: 14056kb

input:

54589 934238577
A 426157661
B 731298047
C 238356016
D 327872720
E 883602635
F 118182006
G 958721654
H 486056423
I 568843934
J 711551424
K 453315009
L 350421124
M 668088075
N 105446842
O 831801452
P 79487681
Q 103675132
R 576395265
S 971309192
T 78045673
U 674894656
V 179462575
W 557585061
X 38900798...

output:

4072850284

result:

ok single line: '4072850284'

Test #21:

score: 0
Accepted
time: 3ms
memory: 3744kb

input:

7 879093735
A 850928522
B 350468065
C 748796252
D 837694952
E 348921976
F 756802752
G 534822329
2052
B 967262777
B 393967428
E 502284363
A 940905594
E 810277410
A 568791040
D 511480180
G 65731261
E 671267678
F 595597916
F 240588953
B 180979922
C 671054842
B 914129862
D 260422699
F 669613469
E 197144...

output:

0

result:

ok single line: '0'

Test #22:

score: 0
Accepted
time: 3ms
memory: 3772kb

input:

6 842299994
A 379167737
B 115169471
C 119285747
D 943499403
E 177449883
F 10220555
1569
B 697422586
C 400884912
C 269415831
E 828123297
B 849064734
E 704245857
E 610386292
B 877095846
D 518961752
C 523904020
C 495900322
C 933105747
C 450242097
A 769402759
E 287913977
C 404068305
E 781388043
D 472512...

output:

0

result:

ok single line: '0'

Test #23:

score: 0
Accepted
time: 51ms
memory: 18476kb

input:

64738 943472339
A 979065476
B 832949548
C 152126332
D 575907209
E 811321449
F 712120870
G 723326799
H 889941752
I 467316971
J 595719757
K 927907719
L 53991523
M 673203943
N 126964655
O 824177390
P 4268947
Q 290023999
R 461758370
S 323213342
T 311180813
U 865360504
V 661904574
W 181180161
X 721973291...

output:

0

result:

ok single line: '0'

Test #24:

score: 0
Accepted
time: 3ms
memory: 3748kb

input:

8 53861228
A 891720756
B 341615418
C 247127721
D 114705614
E 794800619
F 535476057
G 472546264
H 17162179
2164
D 59853020
B 972442325
F 406778948
G 583852826
E 818558037
H 237153728
F 791306889
D 938863078
A 481681370
C 501216450
H 276218794
C 564718804
F 61396156
B 32108808
E 268680596
D 740046589
...

output:

0

result:

ok single line: '0'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3676kb

input:

7 412675199
A 917821399
B 836089065
C 131844033
D 670963745
E 429723800
F 400355535
G 977010106
1727
F 308538376
B 935247759
D 491075499
C 374071258
A 224676327
E 676481834
G 423340823
D 641914255
B 704683198
A 377398567
G 272649163
C 304228705
G 376493987
G 606275219
F 830823140
B 812720422
F 17191...

output:

0

result:

ok single line: '0'

Test #26:

score: 0
Accepted
time: 23ms
memory: 14628kb

input:

57374 711276406
A 613156442
B 82011174
C 10463444
D 12802565
E 437036386
F 95927948
G 350288062
H 151941178
I 646283948
J 677004796
K 990479171
L 789096157
M 564621747
N 355408210
O 507084367
P 12697544
Q 211495000
R 602910948
S 76342025
T 199206245
U 80989675
V 490978999
W 438227462
X 501156116
Y 7...

output:

0

result:

ok single line: '0'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

6 332497508
A 711034572
B 407702010
C 568304901
D 659423025
E 316462184
F 367066900
5
A 595718092
E 48734900
D 343645794
D 451342914
A 630129036

output:

3722372394

result:

ok single line: '3722372394'

Test #28:

score: 0
Accepted
time: 3ms
memory: 4036kb

input:

1666 451934537
A 342650525
B 91252632
C 298571149
D 817065369
E 853857673
F 81868669
G 422520903
H 322430130
I 196304023
J 456374454
K 927449288
L 497007895
M 929749589
N 545239160
O 535738197
P 64154330
Q 557982713
R 89376619
S 485410593
T 580548727
U 157583689
V 976335802
W 986118132
X 849368305
Y...

output:

0

result:

ok single line: '0'

Test #29:

score: 0
Accepted
time: 1ms
memory: 4092kb

input:

1651 407668104
A 458317692
B 909435400
C 741022991
D 233178625
E 313863379
F 7949477
G 141369403
H 630890074
I 66872471
J 279856115
K 923864992
L 151312340
M 417007154
N 399894770
O 69017739
P 548150733
Q 437095676
R 220116084
S 253200337
T 301479723
U 156710761
V 626785328
W 1882138
X 755509454
Y 2...

output:

0

result:

ok single line: '0'

Test #30:

score: 0
Accepted
time: 59ms
memory: 16932kb

input:

55686 808700322
A 34664429
B 917493539
C 860519058
D 806167135
E 196866799
F 857809984
G 933756527
H 978074492
I 86246168
J 205452256
K 615177430
L 631659858
M 472137097
N 109420732
O 265983334
P 563177753
Q 79568891
R 625998292
S 798618556
T 499423935
U 866419872
V 812223015
W 749984116
X 593584291...

output:

0

result:

ok single line: '0'

Test #31:

score: 0
Accepted
time: 36ms
memory: 14260kb

input:

55068 670749199
A 354429008
B 534732910
C 476171149
D 39980987
E 7922157
F 785200131
G 72923364
H 128554320
I 703066856
J 491260143
K 389319695
L 910861355
M 620520758
N 232407731
O 482501720
P 285917225
Q 871459300
R 897151314
S 856870482
T 581791393
U 255026002
V 257072875
W 527993351
X 5605973
Y ...

output:

0

result:

ok single line: '0'

Test #32:

score: 0
Accepted
time: 19ms
memory: 6004kb

input:

8 1302605
A 134287489
B 573282005
C 300684184
D 837596997
E 827512071
F 582064343
G 494505886
H 541393637
54301
C 585334477
B 41308975
B 937525630
F 904321787
G 784948851
F 249994222
G 282089489
B 555497919
E 118133744
C 19250881
E 996634220
D 807449144
H 366721213
C 803919575
D 77742245
A 939221251...

output:

0

result:

ok single line: '0'

Test #33:

score: 0
Accepted
time: 35ms
memory: 15840kb

input:

65692 141672743
A 879111798
B 208999764
C 219696947
D 335711396
E 994357505
F 841578478
G 650693339
H 131587825
I 800838292
J 50756269
K 226369807
L 250533548
M 700677866
N 979860504
O 20239766
P 652697062
Q 541122563
R 680348402
S 687780120
T 228125455
U 681569920
V 608655539
W 45180496
X 377028083...

output:

0

result:

ok single line: '0'

Test #34:

score: 0
Accepted
time: 3ms
memory: 3824kb

input:

8 937449651
A 132265030
B 466908475
C 536633364
D 333405397
E 446012016
F 189415547
G 97170372
H 511334059
2302
H 274089471
H 720270279
C 320288129
B 54458530
C 556081819
D 138819439
B 703339773
C 88307151
C 497799547
G 503433922
H 734206266
B 87503806
D 823570154
H 149232652
B 206861255
E 878946850...

output:

0

result:

ok single line: '0'

Test #35:

score: 0
Accepted
time: 1ms
memory: 3964kb

input:

1449 10923999
A 663761329
B 98982403
C 98188974
D 801248187
E 815496608
F 469049136
G 431475286
H 664339712
I 216554048
J 406215776
K 244437043
L 241651531
M 632573840
N 274839844
O 581816514
P 957938624
Q 178553700
R 572318284
S 110717151
T 418572568
U 106199122
V 418140358
W 438960064
X 558540062
...

output:

0

result:

ok single line: '0'

Test #36:

score: 0
Accepted
time: 19ms
memory: 6012kb

input:

7 823300961
A 721849235
B 700707242
C 643102502
D 81447467
E 486710849
F 835244553
G 906828063
56493
E 842344104
G 98591759
A 931741972
A 892916194
G 176433338
B 588709412
A 650523027
D 999189608
A 947818425
B 695834149
A 13889810
D 746695432
F 535129636
D 75253858
C 100428190
B 429077751
B 55665355...

output:

0

result:

ok single line: '0'

Test #37:

score: 0
Accepted
time: 19ms
memory: 8380kb

input:

57 868750896
A 404861638
B 45332195
C 636257002
D 442790255
E 764452001
F 496390941
G 100558829
H 109071496
I 825410260
J 454859111
K 507977989
L 58855441
M 660079869
N 236590656
O 558128363
P 669440808
Q 24054160
R 631971551
S 658443629
T 231980163
U 165402378
V 509899789
W 368656077
X 812803319
Y ...

output:

45058035839168

result:

ok single line: '45058035839168'

Test #38:

score: 0
Accepted
time: 67ms
memory: 21316kb

input:

85565 707071591
A 887733008
B 867938476
C 806988939
D 550192346
E 760098436
F 352438566
G 965215269
H 935667009
I 391055044
J 756582017
K 973262091
L 919574183
M 584331081
N 775915386
O 175156350
P 45635734
Q 928578594
R 496640571
S 678764224
T 268507085
U 110048928
V 167477822
W 909636174
X 8379317...

output:

346372293431

result:

ok single line: '346372293431'

Test #39:

score: 0
Accepted
time: 2ms
memory: 3588kb

input:

14 716061531
A 498316749
B 373305418
C 455531456
D 765787205
E 593658461
F 63911294
G 983798535
H 348572033
I 606225225
J 729414669
K 799648912
L 230507042
M 226990172
N 621879747
339
N 464456354
N 601653126
G 983806768
K 799666165
B 373316428
J 126108232
H 348581656
H 317960564
N 446278844
F 575408...

output:

206967461904

result:

ok single line: '206967461904'

Test #40:

score: 0
Accepted
time: 2ms
memory: 3568kb

input:

18 512022636
A 270775411
B 369733299
C 49626174
D 819800834
E 495563531
F 601796770
G 41428420
H 556211927
I 313414220
J 44461966
K 613262402
L 546577861
M 322057063
N 347541241
O 295279751
P 545302975
Q 241307800
R 502384107
929
A 270780511
H 556228614
M 99126278
G 41435429
J 14075616
N 347547952
N...

output:

393771446000

result:

ok single line: '393771446000'

Test #41:

score: 0
Accepted
time: 86ms
memory: 22868kb

input:

98706 868485793
A 255549860
B 723992922
C 348458122
D 987124485
E 747413436
F 486119762
G 190998737
H 527113823
I 40878035
J 83860806
K 425164312
L 937370582
M 33562252
N 563809
O 575488324
P 17029507
Q 560570217
R 730720818
S 909862584
T 924344187
U 477812426
V 188807262
W 295224870
X 861093251
Y 8...

output:

69188101589

result:

ok single line: '69188101589'

Test #42:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

19 837409111
A 960332080
B 35838479
C 909407355
D 945376388
E 564946990
F 126137903
G 511850489
H 877228125
I 259743508
J 294381172
K 102476865
L 686897775
M 183973949
N 295012092
O 118606363
P 433336465
Q 600689087
R 852587282
S 360369284
13
N 92679049
I 255896871
K 17737057
J 84203075
A 960350028
...

output:

5852559653

result:

ok single line: '5852559653'

Test #43:

score: 0
Accepted
time: 59ms
memory: 16820kb

input:

71969 202752801
A 382951691
B 739041175
C 863497953
D 387446399
E 88824447
F 886573339
G 390101783
H 197276337
I 415045353
J 793102088
K 875088205
L 532879073
M 788426677
N 701301976
O 117842785
P 406122078
Q 61077364
R 193621992
S 186548478
T 975995066
U 519624586
V 687450586
W 576861203
X 50885601...

output:

6347188034

result:

ok single line: '6347188034'

Test #44:

score: 0
Accepted
time: 2ms
memory: 3532kb

input:

11 90128559
A 96073708
B 557367810
C 510535449
D 236188234
E 119565591
F 116812097
G 872188870
H 132097649
I 62534865
J 41202308
K 1261729
13
J 41212383
J 41228436
C 56737050
A 96082026
J 15998546
B 725862
C 510544327
E 16105215
H 47230290
G 872189538
D 236205531
F 996250
E 119580602

output:

3664846586

result:

ok single line: '3664846586'

Test #45:

score: 0
Accepted
time: 92ms
memory: 21992kb

input:

93897 663245808
A 546092314
B 97330706
C 133202163
D 977594261
E 867787194
F 569284262
G 601336862
H 310557327
I 673481238
J 167644682
K 758020743
L 589353890
M 262672375
N 479559508
O 53442482
P 258656394
Q 383953020
R 388234323
S 980984148
T 799351085
U 509036146
V 493367099
W 331558521
X 92836485...

output:

6108436785

result:

ok single line: '6108436785'

Test #46:

score: 0
Accepted
time: 1ms
memory: 3632kb

input:

72 54024919
A 22122104
B 54174308
C 641782797
D 341762140
E 180445632
F 75024829
G 916081797
H 138581810
I 418239325
J 735301871
K 758942193
L 982849863
M 991565997
N 480219693
O 560369126
P 689184540
Q 459159302
R 704265287
S 216981120
T 110674537
U 550244814
V 954635178
W 376110966
X 338088732
Y 4...

output:

8625484793

result:

ok single line: '8625484793'

Test #47:

score: 0
Accepted
time: 2ms
memory: 3628kb

input:

15 506733605
A 200132320
B 408054064
C 61840160
D 714427361
E 3036590
F 844256496
G 678668519
H 822086182
I 182860444
J 439974783
K 635189027
L 794249900
M 711476908
N 435739232
O 864660044
734
L 794252133
E 568381
A 75601178
G 587438320
J 439978109
A 74799
O 77600849
G 394110242
N 78346413
J 729252...

output:

418403225876

result:

ok single line: '418403225876'

Test #48:

score: 0
Accepted
time: 2ms
memory: 3620kb

input:

41 990886280
A 776057746
B 975263771
C 813174358
D 286868823
E 736266493
F 695653047
G 12298113
H 464897987
I 737595479
J 656690974
K 296907680
L 92435290
M 456032516
N 217461560
O 91774943
P 745681162
Q 318794159
R 780778145
S 148797109
T 807671052
U 755668529
V 453779878
W 928702889
X 780254498
Y ...

output:

561541694442

result:

ok single line: '561541694442'

Test #49:

score: 0
Accepted
time: 2ms
memory: 3632kb

input:

15 240697118
A 714886699
B 512719457
C 241048697
D 185865711
E 701230404
F 960266273
G 651575062
H 403470323
I 103230797
J 434353788
K 227499384
L 511136710
M 232192079
N 173766750
O 163905081
789
F 733392245
E 485916080
E 99048765
K 197355487
K 216137879
K 227502259
O 163916330
H 297630306
K 410002...

output:

332484400880

result:

ok single line: '332484400880'

Test #50:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

18 254338443
A 530679548
B 420530397
C 811698741
D 878206449
E 413180068
F 25439685
G 946459980
H 146358489
I 886971594
J 472616835
K 225405948
L 3337465
M 61470744
N 534742415
O 89050167
P 245384457
Q 701145799
R 49302929
9
Q 536335535
B 264172247
K 7308732
K 207936690
M 61475717
G 58169854
I 88698...

output:

5342760600

result:

ok single line: '5342760600'

Test #51:

score: 0
Accepted
time: 62ms
memory: 18716kb

input:

82166 500456870
A 308146266
B 530990125
C 451821441
D 32158706
E 923913242
F 209435781
G 930853683
H 34645925
I 603963955
J 201618549
K 927823906
L 75585559
M 210188749
N 70880579
O 240894725
P 572698047
Q 762557427
R 494807376
S 772814971
T 14346808
U 449735419
V 939023825
W 341191794
X 704508588
Y...

output:

5563279362

result:

ok single line: '5563279362'

Test #52:

score: -100
Wrong Answer
time: 114ms
memory: 21836kb

input:

70244 5797535
A 589397504
B 747542209
C 900871279
D 347743398
E 475680917
F 161497885
G 146523991
H 67933403
I 2456767
J 684854825
K 638215676
L 329608111
M 108644383
N 591790673
O 922462724
P 698200074
Q 832711885
R 593128538
S 884462408
T 817690549
U 575413680
V 573791044
W 64730011
X 651771125
Y ...

output:

33641582210530

result:

wrong answer 1st lines differ - expected: '33639632879972', found: '33641582210530'