求调
查看原帖
求调
682844
abc_mx楼主2023/8/16 15:25

AC 10,其余全WA

#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
const double pi = 3.1415926535897932385;
typedef long long ll;
typedef pair<int,int> Pr;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}, eps=1e3+10, maxn=1e6+10;
template <typename T> inline void read(T &x) {
	x = 0;
	bool flag = false;
	char ch = getchar();
	while (ch < '0' || ch > '9') flag = ch == '-' ? true : false, ch = getchar();
	while (ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + (ch & 15), ch = getchar();
	if(flag) x = -x;
}
template <typename T> inline void write(T x) {
	if(x<0) {
		putchar('-');
		x = -x;
	}
	if(x>9) write(x / 10);
	putchar(x % 10 + '0');
}
ll n, l, r;
string s;
int main() {
    read(n), read(l), read(r);
    cin >> s;
    if(n == l){
    	cout << s;
    	return 0;
	}
	else if(l == 0){
		for(int i = 0;i < s.size(); ++i){
			s[i] = 'a'; 
		}
		cout << s;
		return 0;
	}
	ll cnt = n - l;
	for(int i = 0;i < s.size(); ++i){
		if(cnt == 0) break;
		if(s[i] == 'a') continue;
		cnt--;
		s[i] = 'a';
	}
	cout << s;
	return 0;
}

2023/8/16 15:25
加载中...