QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#612741 | #8937. Stage: Agausscrab | ticking_away# | WA | 0ms | 3832kb | C++20 | 1.9kb | 2024-10-05 12:45:47 | 2024-10-05 12:45:48 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ui = unsigned int;
using ull = unsigned long long;
using ll = long long;
#define endl '\n'
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int maxn = 2e5 + 10;
const int mod = 1000000007;
#define inl inline
#define fr(i, a, b) for (int i = a; i <= b; i++)
#define ford(i, a, b) for (int i = a; i >= b; i--)
#define forall(i, a) for (auto &i : a)
/**
____ ___ _____
/ ___| _ _ / _ \___ /
\___ \| | | | | | ||_ \
___) | |_| | |_| |__) |
|____/ \__, |\___/____/
|___/
*/
istream &operator>>(istream &in, vector<int> &v)
{
for (auto &i : v)
in >> i;
return in;
}
ostream &operator<<(ostream &out, vector<int> &v)
{
for (auto &i : v)
out << i << " ";
return out;
}
bool _output = 0;
void solve()
{
int n;
cin >> n;
vector<pair<string, int>> a(n);
fr(i, 1, n)
{
cin >> a[i - 1].first >> a[i - 1].second;
}
auto b = a;
sort(a.begin(), a.end(), [&](pair<string, int> a, pair<string, int> b)
{ return a.second > b.second; });
int rk = 1;
map<string, int> mp;
fr(i, 1, n)
{
auto &s = a[i - 1].first;
mp[s] = rk;
if (i > 1 && a[i - 2].second == a[i - 1].second)
{
mp[s] = mp[a[i - 2].first];
}
rk++;
}
cout << "Stage: ";
string ans = "";
for (int i = 0; i < n; i++)
{
auto s = b[i].first;
int p = mp[s];
while (p-- && s.size())
{
s.pop_back();
}
ans += s;
}
if (ans.size())
ans[0] = toupper(ans[0]);
cout << ans << endl;
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int _ = 1;
if (_output)
cin >> _;
while (_--)
solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
input:
4 arcos 2 gausr 5 scrail 3 bei 3
output:
Stage: Agausscrab
result:
ok single line: 'Stage: Agausscrab'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
4 zhe 1 jiang 3 sheng 5 sai 2
output:
Stage: Jiashen
result:
ok single line: 'Stage: Jiashen'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1 yp 1
output:
Stage: Y
result:
ok single line: 'Stage: Y'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
2 ut 1 fg 1
output:
Stage: Uf
result:
ok single line: 'Stage: Uf'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
8 pz 1 ym 1 hi 1 mv 1 jh 1 jd 1 ok 1 lc 1
output:
Stage: Pyhmjjol
result:
ok single line: 'Stage: Pyhmjjol'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
8 cm 2 uk 2 ls 2 ay 1 vr 2 zt 1 al 2 ze 2
output:
Stage: Culvaz
result:
ok single line: 'Stage: Culvaz'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
8 si 2 vh 2 pb 3 fb 3 uy 1 pa 1 rm 2 no 2
output:
Stage: Pf
result:
ok single line: 'Stage: Pf'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
8 vs 4 aa 4 tx 1 oe 1 ge 2 il 4 zj 2 cy 1
output:
Stage: Vai
result:
ok single line: 'Stage: Vai'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
8 hj 5 xu 5 yg 4 tp 3 eo 3 gt 4 hk 2 ua 3
output:
Stage: Hx
result:
ok single line: 'Stage: Hx'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
8 vh 1 kfa 1 dlq 1 zf 1 qkt 1 ako 1 rds 1 wus 1
output:
Stage: Vkfdlzqkakrdwu
result:
ok single line: 'Stage: Vkfdlzqkakrdwu'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
8 my 1 hgw 2 nrc 2 gux 2 bjp 1 wme 2 frt 1 ci 1
output:
Stage: Hgnrguwm
result:
ok single line: 'Stage: Hgnrguwm'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
8 ci 3 ms 1 vw 3 ca 3 nn 3 de 1 fn 1 uq 2
output:
Stage: Cvcn
result:
ok single line: 'Stage: Cvcn'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
8 oa 4 rt 3 ak 1 hh 3 ita 3 ltp 4 wy 3 tt 3
output:
Stage: Olt
result:
ok single line: 'Stage: Olt'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
8 nv 1 ki 3 ete 1 gtv 4 dvm 5 kd 5 gay 2 bx 5
output:
Stage: Dvkb
result:
ok single line: 'Stage: Dvkb'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
8 bpas 1 jfx 1 fpq 1 eiq 1 lj 1 pn 1 bo 1 nj 1
output:
Stage: Bpajffpeilpbn
result:
ok single line: 'Stage: Bpajffpeilpbn'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
8 rh 1 ur 2 fmf 2 xner 1 dyte 2 qquq 2 mcw 2 kj 1
output:
Stage: Ufmdytqqumc
result:
ok single line: 'Stage: Ufmdytqqumc'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
8 iqmf 1 jug 3 vheq 2 qol 2 nq 1 fm 2 zh 2 zb 3
output:
Stage: Juvz
result:
ok single line: 'Stage: Juvz'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
8 um 4 zejz 3 rdi 2 lbai 3 pip 2 yqst 4 xjd 4 gvhu 2
output:
Stage: Uyqsxj
result:
ok single line: 'Stage: Uyqsxj'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
8 owf 5 bj 2 owm 2 erz 5 wxt 2 zuf 2 zbd 5 lh 3
output:
Stage: Owerzb
result:
ok single line: 'Stage: Owerzb'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
8 zxp 1 nlid 1 iqqo 1 ly 1 luvc 1 eiub 1 wqzwg 1 zgd 1
output:
Stage: Zxnliiqqlluveiuwqzwzg
result:
ok single line: 'Stage: Zxnliiqqlluveiuwqzwzg'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
8 bhw 1 khsm 2 uvtv 1 zbae 2 qk 2 weeoj 2 chbrr 1 xj 1
output:
Stage: Khszbaqweeo
result:
ok single line: 'Stage: Khszbaqweeo'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
8 ndi 3 zlxmi 3 ewcl 1 srcal 2 egfp 3 acog 1 zrvq 3 af 1
output:
Stage: Ndzlxmegfzrv
result:
ok single line: 'Stage: Ndzlxmegfzrv'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
8 euq 1 al 4 sj 1 hbv 4 ihr 4 yebj 4 nvrmw 3 towa 1
output:
Stage: Ahbihyeb
result:
ok single line: 'Stage: Ahbihyeb'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
8 uep 4 mlq 2 pbtci 4 vlc 4 px 2 ctrx 5 afsg 4 bj 2
output:
Stage: Upbtvctraf
result:
ok single line: 'Stage: Upbtvctraf'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
32 fr 1 ay 1 wc 1 ls 1 kp 1 rw 1 lh 1 kj 1 ku 1 oe 1 lh 1 ea 1 py 1 al 1 zj 1 ee 1 gw 1 if 1 sy 1 kz 1 in 1 vl 1 ds 1 la 1 qi 1 ut 1 ub 1 zq 1 bi 1 mu 1 ia 1 kv 1
output:
Stage: Fawlkrlkkolepazegiskivdlquuzbmik
result:
ok single line: 'Stage: Fawlkrlkkolepazegiskivdlquuzbmik'
Test #26:
score: -100
Wrong Answer
time: 0ms
memory: 3792kb
input:
32 vb 2 fa 1 aq 1 mz 1 tz 1 he 2 be 1 yt 1 cc 2 xu 2 qy 1 wa 1 eg 1 qd 2 kg 2 tf 2 tb 1 im 2 ap 1 re 2 qz 2 fl 2 cq 1 yt 2 nc 1 sj 1 ac 1 dd 2 hk 2 rq 1 ne 2 hv 2
output:
Stage: Vhcxqktirqfdhnh
result:
wrong answer 1st lines differ - expected: 'Stage: Vhcxqktirqfydhnh', found: 'Stage: Vhcxqktirqfdhnh'