QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#694454#8937. Stage: Agausscrab2018haha#WA 0ms3780kbC++17761b2024-10-31 17:59:052024-10-31 17:59:18

Judging History

你现在查看的是最新测评结果

  • [2024-10-31 17:59:18]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3780kb
  • [2024-10-31 17:59:05]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    vector<pair<string,int>> s(n);
    vector<int> r(n,1);
    for(int i=0;i<n;i++)
        cin>>s[i].first>>s[i].second;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<=n;j++)
        {
            if(i==j) continue;
            auto &[s1,a1]=s[i];
            auto &[s2,a2]=s[j];
            if(a2>a1) r[i]++;
        }
    }
    string ans;
    for(int i=0;i<n;i++)
    {
        string tmp=s[i].first;
        if(r[i]>=tmp.length()) continue;
        ans+=tmp.substr(0,tmp.length()-r[i]);
    }
    if(ans.size()) ans[0]-=32;
    cout<<"Stage: "<<ans<<"\n";
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3620kb

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: 3780kb

input:

4
zhe 1
jiang 3
sheng 5
sai 2

output:

Stage: Jiashen

result:

ok single line: 'Stage: Jiashen'

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3548kb

input:

1
yp 1

output:

Stage: 

result:

wrong answer 1st lines differ - expected: 'Stage: Y', found: 'Stage: '