| Task: | Tulostaulu |
| Sender: | Verlet |
| Submission time: | 2025-01-18 14:42:23 +0200 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | 100 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 20 |
| #2 | ACCEPTED | 20 |
| #3 | ACCEPTED | 60 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.01 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 |
Code
#include <bits/stdc++.h>
#define newl "\n"
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> ip;
typedef pair<ll, ll> lp;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int n, m, k; cin >> n >> m >> k;
vector<string> names(n);
for (int i = 0; i < n; i++) cin >> names[i];
sort(names.rbegin(), names.rend());
map<string, array<int, 256>> map;
for (int i = 0; i < m; i++)
{
string name; cin >> name;
char problem; cin >> problem;
int points; cin >> points;
int current = map[name][problem];
if (points > current)
{
map[name][problem] = points;
map[name][0] = m - i;
}
}
vector<array<int, 3>> s;
// 0 points
// 1 time
// 2 name index
for (int i = 0; i < n; i++)
{
string name = names[i];
int points = 0;
for (char c = 'A'; c < 'A' + k; c++)
{
points += map[name][c];
}
int time = map[name][0];
s.pb({points, time, i});
}
sort(s.rbegin(), s.rend());
for (int i = 0; i < n; i++)
{
cout << names[s[i][2]] << " " << s[i][0] << endl;
}
}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 |
