CSES - Datatähti 2025 loppu - Results
Submission details
Task:Tulostaulu
Sender:Pikaksi
Submission time:2025-01-18 13:11:49 +0200
Language:C++ (C++20)
Status:READY
Result:20
Feedback
groupverdictscore
#1ACCEPTED20
#20
#30
Test results
testverdicttimegroup
#1ACCEPTED0.01 s1, 3details
#20.01 s2, 3details
#30.01 s3details
#4ACCEPTED0.00 s1, 2, 3details
#5ACCEPTED0.01 s3details
#60.01 s3details

Code

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
// chmod u+x b.sh
void solve(); int main() {
    ios_base::sync_with_stdio(0); cout.tie(0);
    solve();
}

ll t[110][11];
ll sum[110];

void solve()
{
    int n, m, k;
    cin >> n >> m >> k;
    map<string, int> p;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        p.insert({s, i});
    }
    for (int i = 0; i < m; i++) {
        string s;
        cin >> s;
        char a;
        cin >> a;
        ll tulos;
        cin >> tulos;
        t[p[s]][a - 'A'] = max(t[p[s]][a - 'A'], tulos);
    }

    multimap<ll, string, greater<>> ans;
    for (auto [name, ind] : p) {
        for (int k = 0; k < 10; k++) {
            sum[ind] += t[ind][k];
        }
        ans.insert({sum[ind], name});
    }
    for (auto [tulos, peop] : ans) {
        cout << peop << " " << tulos << "\n";
    }
    
}

Test details

Test 1

Group: 1, 3

Verdict: ACCEPTED

input
1 5000 10
zsyad
zsyad J 14
zsyad A 40
zsyad D 34
...

correct output
zsyad 1000

user output
zsyad 1000

Test 2

Group: 2, 3

Verdict:

input
100 5000 1
eayoy
mkiie
sqd
mgq
...

correct output
ujogxx 100
dadxy 100
ttldevgm 100
awbj 100
j 100
...

user output
ajufhjpw 100
awbj 100
bkq 100
btee 100
dadxy 100
...
Truncated

Test 3

Group: 3

Verdict:

input
100 5000 10
bsvhdn
xlxadb
gbc
sadll
...

correct output
ezgermxsii 927
urclsrvlq 924
shgvs 919
xwkqtroxqr 918
oovi 893
...

user output
ezgermxsii 927
urclsrvlq 924
shgvs 919
xwkqtroxqr 918
oovi 893
...
Truncated

Test 4

Group: 1, 2, 3

Verdict: ACCEPTED

input
1 0 1
xoezwspspf

correct output
xoezwspspf 0

user output
xoezwspspf 0

Test 5

Group: 3

Verdict: ACCEPTED

input
100 5000 10
bwv
jxz
cpktj
mhzevc
...

correct output
afvgeut 0
ai 0
amfrsvuqao 0
beadkfbr 0
bkgztu 0
...

user output
afvgeut 0
ai 0
amfrsvuqao 0
beadkfbr 0
bkgztu 0
...
Truncated

Test 6

Group: 3

Verdict:

input
100 5000 10
yifvbbjcz
cnpkni
qvltt
ngpe
...

correct output
vgyo 10
msgagpngrd 10
cnpkni 10
lpwlq 10
qguwtubeqi 10
...

user output
abogziwuhl 10
azogo 10
badqyqurip 10
bjriexj 10
bkilv 10
...
Truncated