QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#726784#8937. Stage: AgausscrabtreeiiiRE 0ms16660kbC++201.5kb2024-11-09 08:32:572024-11-09 08:32:57

Judging History

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

  • [2024-11-09 08:32:57]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:16660kb
  • [2024-11-09 08:32:57]
  • 提交

answer

//妈的天天挂分,傻逼吧
//如此状态,如何noip?

#include<bits/stdc++.h>
#define int long long
#define _int __int128
#define y1 _
using namespace std;

static char buf[1000000],*p1=buf,*p2=buf;

inline int read(){
	char c=getchar();
	int res=0,f=1;
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		res=res*10+c-'0';
		c=getchar();
	}
	return res*f;
}

inline void write(int x){
	static char buf[20];
	static int len=-1;
	if(x<0){
		putchar('-');
		x=-x;
	}
	do{
		buf[++len]=x%10;
		x/=10;
	}
	while(x);
	while(len>=0){
		putchar(buf[len--]+48);
	}
}

const int maxn=300005;
const int maxm=510;
const int inf=1e18;
const int bas=100;
const int mod=1e9+7;
const double eps=1e-4;

int n;

struct node{
	string s;
	int w;
}a[maxn];

int b[maxn];

map<int,int> mp;

void solve(){
	n=read();
	for(int i=1;i<=n;i++){
		cin>>a[i].s;
		a[i].s=" "+a[i].s;
		a[i].w=read();
		b[i]=a[i].w;
	}
	sort(b+1,b+n+1);
	for(int i=1;i<=n;i++){
		int cnt=0;
		for(int j=i+1;j<=n;j++){
			if(b[j]>b[i]){
				cnt++;
			}
		}
		mp[b[i]]=cnt;
	}
	string ans="";
	for(int i=1;i<=n;i++){
		for(int j=1;j<=a[i].s.size()-mp[a[i].w]-2ll;j++){
			ans.push_back(a[i].s[j]);
		}
	}
	ans[0]=(ans[0]-'a'+'A');
	cout<<"Stage: "<<ans<<endl;
	return ;
}

signed main(){
	//	freopen("puxi.in","r",stdin);
	//	freopen("puxi.out","w",stdout);
	int T=1;
	//	T=read();
	while(T--){
		solve();
	}
	return 0;
}

详细

Test #1:

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

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:


result: