QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#816060 | #8937. Stage: Agausscrab | pengpeng18 | WA | 0ms | 3604kb | C++14 | 850b | 2024-12-15 21:32:46 | 2024-12-15 21:32:47 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
struct ST{
string s;
int a;
int b;
int c;
};
bool cmp(ST A,ST B){
return A.a>B.a;
}
bool cmp2(ST A,ST B){
return A.b<B.b;
}
int main(){
int n;
cin>>n;
vector<ST>st(n);
for(int i=0;i<n;i++)
{
cin>>st[i].s>>st[i].a;
st[i].b=i+1;
}
sort(st.begin(),st.end(),cmp);
for(int i=0;i<n;i++)
{
if(st[i].a==st[i-1].a)st[i].c=st[i-1].c;
else st[i].c=i+1;
}
sort(st.begin(),st.end(),cmp2);
// for(auto t:st){
// cout<<t.s<<" "<<t.a<<" "<<t.b<<" "<<t.c<<" ";
// puts("");
// }
string s;
for(int i=0;i<n;i++)
{
ST t=st[i];
s+=t.s.substr(0,t.s.size()-t.c);
}
s[0]-=32;
cout<<"Stage: ";
cout<<s;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3604kb
input:
4 arcos 2 gausr 5 scrail 3 bei 3
output:
Stage: Agausscrab
result:
ok single line: 'Stage: Agausscrab'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3544kb
input:
4 zhe 1 jiang 3 sheng 5 sai 2
output:
Stage: Zhejiashen
result:
wrong answer 1st lines differ - expected: 'Stage: Jiashen', found: 'Stage: Zhejiashen'