QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#834456#8937. Stage: AgausscrabL3067545513#WA 0ms11572kbC++23685b2024-12-27 17:25:162024-12-27 17:25:16

Judging History

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

  • [2024-12-27 17:25:16]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:11572kb
  • [2024-12-27 17:25:16]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long 
#define pb push_back
const int M = 2e5 + 7;
struct S{
	std::string s;
	int a;
}a[M];
signed main () {
	int n; std::cin >> n;
	std::vector<int> b;
	for(int i = 1; i <= n; ++ i) {
		std::cin >> a[i].s >> a[i].a;
		b.pb(a[i].a);
	}
	std::sort(b.begin() , b.end());
	int cnt = 0;
	std::cout << "Stage:";
	for(int i = 1; i <= n; ++ i) {
		int pos = std::upper_bound(b.begin() , b.end() , a[i].a) - b.begin() + 1;
		pos --;
		pos = n - pos + 1;
//		std::cout << pos << ' ';
		for(int j = 0; j < (int)a[i].s.size() - pos; ++ j , cnt ++) if(cnt == 0) std::cout << (char)(a[i].s[j] -32); else std::cout << a[i].s[j];
	}	
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 11572kb

input:

4
arcos 2
gausr 5
scrail 3
bei 3

output:

Stage:Agausscrab

result:

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