QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#816060#8937. Stage: Agausscrabpengpeng18WA 0ms3604kbC++14850b2024-12-15 21:32:462024-12-15 21:32:47

Judging History

This is the latest submission verdict.

  • [2024-12-15 21:32:47]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3604kb
  • [2024-12-15 21:32:46]
  • Submitted

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;
}

详细

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'