| Task: | Tulostaulu |
| Sender: | Kemm1706 |
| Submission time: | 2025-01-18 13:22:36 +0200 |
| Language: | C++ (C++11) |
| 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 'bool ss(item, item)':
input/code.cpp:23:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
23 | if(x.p == y.p)
| ^Code
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector <ll> vl;
typedef vector <vl> vvl;
typedef pair <ll, ll> pl;
typedef vector <pl> vpl;
typedef stack <ll> stl;
typedef set <ll> sl;
#define fi first
#define se second
map <ll, string> ml;
struct item
{
ll p, ord, t;
};
bool ss(item x, item y)
{
if(x.p == y.p)
if(x.p == 0)
return ml[x.ord] < ml[y.ord];
else
return x.t < y.t;
return x.p > y.p;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
ll n, m, k, no, sum, i, j;
string s; char t;
map <string, ll> mp;
cin >> n >> m >> k;
vvl score(n + 1, vl(k, 0));
vl time(n + 1, 0);
for(i = 0; i < n; i++)
{
cin >> s;
mp[s] = i;
ml[i] = s;
}
for(i = 0; i < m; i++)
{
cin >> s >> t >> sum;
no = mp[s];
if(sum > score[no][t - 'A'])
{
score[no][t - 'A'] = sum;
time[no] = i;
}
}
vector <item> ans(n);
item cur;
for(i = 0; i < n; i++)
{
sum = 0;
for(j = 0; j < k; j++)
{
sum += score[i][j];
//cerr << score[i][j] << " ";
}
cur.p = sum; cur.ord = i; cur.t = time[i];
ans[i] = cur;
}
sort(ans.begin(), ans.end(), ss);
for(i = 0; i < n; i++)
cout << ml[ans[i].ord] << " " << ans[i].p << "\n";
return 0;
}
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 |
