Task: | Tulostaulu |
Sender: | vgtcross |
Submission time: | 2025-01-18 13:12:12 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 20 |
#2 | ACCEPTED | 20 |
#3 | ACCEPTED | 60 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.00 s | 1, 3 | details |
#2 | ACCEPTED | 0.01 s | 2, 3 | details |
#3 | ACCEPTED | 0.01 s | 3 | details |
#4 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#5 | ACCEPTED | 0.01 s | 3 | details |
#6 | ACCEPTED | 0.01 s | 3 | details |
Compiler report
input/code.cpp: In function 'void solve()': input/code.cpp:42:53: warning: narrowing conversion of '((- names.std::vector<std::__cxx11::basic_string<char> >::size()) + 1)' from 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing] 42 | ord.push_back({tot, -a.se[10], -names.size()+1}); | ~~~~~~~~~~~~~^~
Code
#include <bits/stdc++.h> #define debug(x) cout << #x << ": " << x << endl #define fi first #define se second #define all(x) begin(x),end(x) #define rall(x) rbegin(x),rend(x) using namespace std; using ll = long long; void solve() { int n, m, k; cin >> n >> m >> k; map<string, array<int, 11>> scr; for (int i = 0; i < n; ++i) { string name; cin >> name; scr[name][0] = 0; } for (int i = 0; i < m; ++i) { string name; char p; int s; cin >> name >> p >> s; if (s > scr[name][p-'A']) { scr[name][10] = i; scr[name][p-'A'] = s; } } vector<string> names; vector<array<int, 3>> ord; for (auto &a : scr) { names.push_back(a.fi); int tot = 0; for (int i = 0; i < 10; ++i) tot += a.se[i]; ord.push_back({tot, -a.se[10], -names.size()+1}); } stable_sort(rall(ord)); for (auto &a : ord) { cout << names[-a[2]] << ' ' << a[0] << '\n'; } } int main() { cin.tie(0) -> sync_with_stdio(0); solve(); }
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: ACCEPTED
input |
---|
100 5000 1 eayoy mkiie sqd mgq ... |
correct output |
---|
ujogxx 100 dadxy 100 ttldevgm 100 awbj 100 j 100 ... |
user output |
---|
ujogxx 100 dadxy 100 ttldevgm 100 awbj 100 j 100 ... Truncated |
Test 3
Group: 3
Verdict: ACCEPTED
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: ACCEPTED
input |
---|
100 5000 10 yifvbbjcz cnpkni qvltt ngpe ... |
correct output |
---|
vgyo 10 msgagpngrd 10 cnpkni 10 lpwlq 10 qguwtubeqi 10 ... |
user output |
---|
vgyo 10 msgagpngrd 10 cnpkni 10 lpwlq 10 qguwtubeqi 10 ... Truncated |