社区讨论
爆零求助
P8437 伟大的神参与者 2已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @lo8bss9n
- 此快照首次捕获于
- 2023/10/27 16:02 2 年前
- 此快照最后确认于
- 2023/10/27 16:02 2 年前
CPP
#include <bits/stdc++.h>
using namespace std;
string a = "";
int main(){
int x,y,z;
cin >> x >> y >> z;
for(int i = 1; i <= y/2;i++){
a = a.append("1r");
}
for(int j = 1; j <= x - y;j++){
if(z - 1 >= x - y){
a = a.append("r");
}
else{
if((x - y) % 3 == 0){
for(int t = 1;t <= (x - y) / 3;t++){
a = a.append("11r");
}
cout << a;
return 0;
}
else{
if((x - y) % 3 == 1){
for(int c = 1;c <= (x - y) / 3;c++){
a = a.append("11r");
}
a = a.append("1");
cout << a;
return 0;
}
if((x - y) % 3 == 2){
for(int k = 1;k <= (x - y) / 3;k++){
a = a.append("11r");
}
a = a.append("11");
cout << a;
return 0;
}
}
}
}
return 0;
}
自测样例符合,但还是爆零
回复
共 2 条回复,欢迎继续交流。
正在加载回复...