CSES - Datatähti 2025 loppu - Results
Submission details
Task:Tulostaulu
Sender:Hattless
Submission time:2025-01-18 13:27:34 +0200
Language:C++ (C++20)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.01 s1, 3details
#20.01 s2, 3details
#30.01 s3details
#40.00 s1, 2, 3details
#50.01 s3details
#60.01 s3details

Code

#include <bits/stdc++.h>
#define ln "\n";
using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m,k;
    cin >> n >> m >> k;
    map<string,vector<int>> mp;
    vector<vector<string>> orders(1100);
    for(int i = 0; i < n; i++) {
        string g;
        cin >> g;
        mp[g] = vector<int>(20);
    }
    for(int i = 0; i < m; i++) {
        string g;
        char d;
        int a;
        cin >> g >> d >> a;
        // cout << g << " ";
        // cout << mp[g][d-'A'] << " ";
        mp[g][d-'A'] = max(mp[g][d-'A'],a);
        // cout << mp[g][d-'A'] << ln;
        int s = 0;
        for(int i = 0; i < 15; i++) {
            s+= mp[g][i];
        }
        orders[s].push_back(g);
    }
    set<string> s;
    for(int i = 1100; i >= 0; i--) {
        if(orders[i].size() == 0) continue;
        for(string g:orders[i]) {
            if(s.find(g) == s.end()) {
                cout << g << " " << i << ln;
                s.insert(g);
            }  
        }
    }
    for(auto [key,val]:mp) {
        if(s.find(key) == s.end()) {
            cout << key << " 0" << ln;
        }
    }
}

Test details

Test 1

Group: 1, 3

Verdict:

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

correct output
zsyad 1000

user output
(empty)

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
(empty)

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
(empty)

Test 4

Group: 1, 2, 3

Verdict:

input
1 0 1
xoezwspspf

correct output
xoezwspspf 0

user output
(empty)

Test 5

Group: 3

Verdict:

input
100 5000 10
bwv
jxz
cpktj
mhzevc
...

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

user output
(empty)

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
(empty)