QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#665639#8937. Stage: Agausscrablytqwq#RE 0ms3812kbC++14665b2024-10-22 14:32:532024-10-22 14:32:56

Judging History

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

  • [2024-10-22 14:32:56]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3812kb
  • [2024-10-22 14:32:53]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1010;
int n;
char s[N][N];
int a[N],wz[N],dk[N];
bool cmp(int x,int y){
	return a[x]<a[y];
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%s%d",s[i]+1,&a[i]);
		wz[i]=i;
	}
	sort(wz+1,wz+n+1,cmp);
	int cnt=0,res=0;
	for(int i=n;i>=1;i--){
		dk[wz[i]]=cnt+1;
		res++;
		if(a[wz[i]]!=a[wz[i-1]]){
			cnt+=res;
			res=0;
		}
	}
	int b=0; 
	printf("Stage: ");
	for(int i=1;i<=n;i++){
		for(int v=1;v<=strlen(s[i]+1)-dk[i];v++){
			if(b==0)printf("%c",s[i][v]-'a'+'A');
			else printf("%c",s[i][v]);
			b=1;
		}
	}
}
/*
4
arcos 2
gausr 5
scrail 3
bei 3
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4
arcos 2
gausr 5
scrail 3
bei 3

output:

Stage: Agausscrab

result:

ok single line: 'Stage: Agausscrab'

Test #2:

score: -100
Runtime Error

input:

4
zhe 1
jiang 3
sheng 5
sai 2

output:

Stage: Zhe

result: