XiaoYiii @ 2024-04-19 18:34:08
你谷的在线IDE跑出来对的,结果全WA了?
人类迷惑行为
#include<bits/stdc++.h>
#define ll long long
using namespace std;
//快读快写板子
using yyy = ll;
inline char gc()
{
static char BB[1000000], * S = BB, * T = BB;
return (S == T) && (T = (S = BB) + fread(BB, 1, 1000000, stdin), S == T) ? EOF : *S++;
}
inline yyy qread()
{
yyy x = 0, f = 1;
char ch = gc();
while (ch < '0' || ch>'9') { if (ch == '-') f = -1; ch = gc(); }
while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = gc(); }
return x * f;
}
inline void qp(ll x)
{
if (x > 9) qp(x / 10);
putchar(x % 10 + '0');
return;
}
inline void qprint(ll x, int y) {
if (x == 0) { putchar('0');}
if (x < 0) { putchar('-'); x = abs(x); }
if(x > 0) qp(x);
switch (y) {
case 1: {
putchar(' ');
break;
}
case 2: {
putchar('\n');
break;
}
default: {
break;
}
}
return;
}
vector <char> st[6];
int n;
int main(){
n = qread();
for(int k = 1; k <= n; k++){
char ch = gc();
switch (ch){
case '0':{
for(int i = 1; i <= 5; i++) st[i].push_back('X');
st[1].push_back('X');
st[5].push_back('X');
for(int i = 2; i <= 4; i++) st[i].push_back('.');
for(int i = 1; i <= 5; i++) st[i].push_back('X');
break;
}
case '1':{
for(int i = 1; i <= 5; i++) st[i].push_back('.');
for(int i = 1; i <= 5; i++) st[i].push_back('.');
for(int i = 1; i <= 5; i++) st[i].push_back('X');
break;
}
case '2':{
for(int i = 1; i <= 3; i++) st[1].push_back('X');
for(int i = 1; i <= 3; i++) st[3].push_back('X');
for(int i = 1; i <= 3; i++) st[5].push_back('X');
for(int i = 1; i <= 2; i++) st[2].push_back('.');
st[2].push_back('X');
st[4].push_back('X');
for(int i = 1; i <= 2; i++) st[4].push_back('.');
break;
}
case '3':{
for(int i = 1; i <= 3; i++) st[1].push_back('X');
for(int i = 1; i <= 3; i++) st[3].push_back('X');
for(int i = 1; i <= 3; i++) st[5].push_back('X');
for(int i = 1; i <= 2; i++) st[2].push_back('.');
st[2].push_back('X');
for(int i = 1; i <= 2; i++) st[4].push_back('.');
st[4].push_back('X');
break;
}
case '4':{
for(int i = 1; i <= 2; i++){
st[i].push_back('X');
st[i].push_back('.');
st[i].push_back('X');
}
for(int i = 1; i <= 3; i++){
st[3].push_back('X');
}
for(int i = 1; i <= 2; i++){
st[4].push_back('.');
st[5].push_back('.');
}
st[4].push_back('X');
st[5].push_back('X');
break;
}
case '5':{
for(int i = 1; i <= 3; i++) st[1].push_back('X');
for(int i = 1; i <= 3; i++) st[3].push_back('X');
for(int i = 1; i <= 3; i++) st[5].push_back('X');
st[2].push_back('X');
for(int i = 1; i <= 2; i++) st[2].push_back('.');
for(int i = 1; i <= 2; i++) st[4].push_back('.');
st[4].push_back('X');
break;
}
case '6':{
for(int i = 1; i <= 5; i++) st[i].push_back('X');
for(int i = 1; i <= 5; i++){
if(i & 1) st[i].push_back('X');
else st[i].push_back('.');
}
for(int i = 1; i <= 5; i++){
if(i != 2) st[i].push_back('X');
else st[i].push_back('.');
}
break;
}
case '7':{
for(int i = 1; i <= 2; i++) st[1].push_back('X');
for(int i = 2; i <= 5; i++) st[i].push_back('.');
for(int i = 2; i <= 5; i++) st[i].push_back('.');
for(int i = 1; i <= 5; i++) st[i].push_back('X');
break;
}
case '8':{
for(int i = 1; i <= 5; i++) st[i].push_back('X');
for(int i = 1; i <= 5; i++){
if(i & 1) st[i].push_back('X');
else st[i].push_back('.');
}
for(int i = 1; i <= 5; i++) st[i].push_back('X');
break;
}
case '9':{
for(int i = 1; i <= 5; i++){
if(i != 4) st[i].push_back('X');
else st[i].push_back('.');
}
for(int i = 1; i <= 5; i++){
if(i & 1) st[i].push_back('X');
else st[i].push_back('.');
}
for(int i = 1; i <= 5; i++) st[i].push_back('X');
break;
}
default:{
break;
}
}
for(int i = 1; i <= 5; i++) st[i].push_back('.');
}
for(int i = 1; i <= 5; i++){
for(int j = 0; j < st[i].size() - 1; j++){
putchar(st[i][j]);
}
putchar('\n');
}
return 0;
}
附上第一个测试点:
6
114514
..X...X.X.X.XXX...X.X.X
..X...X.X.X.X.....X.X.X
..X...X.XXX.XXX...X.XXX
..X...X...X...X...X...X
..X...X...X.XXX...X...X
然后这是我的输出:
..X...X.X.X.XXX...X.X.X
..X...X.X.X.X.....X.X.X
..X...X.XXX.XXX...X.XXX
..X...X...X...X...X...X
..X...X...X.XXX...X...X
by Lawrence003 @ 2024-04-19 19:08:04
???
by Lawrence003 @ 2024-04-19 19:08:28
不是一样的吗?
by jerry139com @ 2024-04-19 19:17:50
\n的问题?(我也不知道)