QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#575382 | #8937. Stage: Agausscrab | lonlyness | WA | 0ms | 3892kb | C++23 | 1.5kb | 2024-09-19 13:34:49 | 2024-09-19 13:34:49 |
Judging History
answer
// _ _ _
// | | ___ _ __ ___ | | (_) _ __ ___ ___ ___
// | | / _ \ | '_ \ / _ \ | | | | | '_ \ / _ \ / __| / __|
// | | | (_) | | | | | | __/ | | | | | | | | | __/ \__ \ \__ \
// |_| \___/ |_| |_| \___| |_| |_| |_| |_| \___| |___/ |___/
//
#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<cmath>
#include<unordered_map>
using namespace std;
#define int long long
#define endl "\n"
const int N=1e5+10;
typedef pair<int,int> PII;
int n,m,k;
void solve()
{
cin>>n;
vector<pair<int,string>>s;
for(int i= 0;i < n;i ++){
int a;
string s1;
cin>>s1>>a;
s.emplace_back(a,s1);
}
auto tem = s;
sort(s.begin(),s.end());
reverse(s.begin(),s.end());
map<string,int>mp;
for(int i= 0;i < n;i ++){
if(i&&s[i].first==s[i-1].first)mp[s[i].second]=mp[s[i-1].second];
else mp[s[i].second]=i+1;
}
string ans;
for(int i = 0;i < n;i ++){
int cnt = mp[tem[i].second];
// cout<<cnt<<endl;
if(cnt>=tem[i].second.size())continue;
else ans+=tem[i].second.substr(0,tem[i].second.size()-cnt);
// cout<<ans<<endl;
}
cout<<"Stage: ";
if(!ans.empty())ans[0]= ans[0]-32;
cout<<ans<<endl;
}
signed main()
{
ios_base::sync_with_stdio(false); cin.tie(nullptr);cout.tie(nullptr);
int t=1;
// cin>>t;
while(t--){
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3688kb
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: 3592kb
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: 3588kb
input:
1 yp 1
output:
Stage: Y
result:
ok single line: 'Stage: Y'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
2 ut 1 fg 1
output:
Stage: Uf
result:
ok single line: 'Stage: Uf'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3656kb
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: 3892kb
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: 3820kb
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: 3820kb
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: 3592kb
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: 3648kb
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: 3652kb
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: 3688kb
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: 3860kb
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: 3892kb
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: 3888kb
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: 3596kb
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: 3892kb
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: 3652kb
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: 3588kb
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: 3628kb
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: 3596kb
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: 3856kb
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: 3600kb
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: 3860kb
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: 3892kb
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: 3600kb
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'