| Task: | Tulostaulu |
| Sender: | AH |
| Submission time: | 2025-01-18 14:25:35 +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 |
Code
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<>,rb_tree_tag,tree_order_statistics_node_update> index_set;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define FOR(i,a,b) for (int i = a; i < b; i++)
constexpr ll MOD = 1000000007;
int main() {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int n, m, k; cin >> n >> m >> k;
map<string, map<char, int>> pta;
map<string, int> pto, ft;
FOR(i,0,n) {
string x; cin >> x;
pto[x] = 0;
}
FOR(i,0,m) {
string a; cin >> a;
char b; cin >> b;
int c; cin >> c;
if (c > pta[a][b]) pta[a][b] = c, ft[a] = -i;
}
for (auto i : pta) {
for (auto j : i.S) {
pto[i.F] += j.S;
}
}
set<pair<pair<int, int>, string>, greater<>> fs;
for (auto i : pto) {
fs.insert({{i.S, ft[i.F]}, i.F});
}
vector<string> ze;
for (auto i : fs) {
if (i.F.F == 0) ze.PB(i.S);
else cout << i.S << " " << i.F.F << "\n";
}
reverse(ze.begin(), ze.end());
for (string i : ze) {
cout << i << " " << 0 << "\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: 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 |
