- P33's solution
-
题解P33
- @ 2025-10-24 22:23:20
按题意直接模拟即可。
AC code:
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n + 1], sums = 0;
for (int i = 1; i <= n; i++) {
cin >> a[i];
sums += a[i];
}
for (int i = 1; i <= n; i++) {
if (a[i] * 5 <= sums) {
for (int j = 1; j <= a[i]; j++) {
cout << "A";
}
cout << endl;
} else {
for (int j = 1; j <= a[i]; j++) {
cout << "B";
}
cout << endl;
}
}
return 0;
}