QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#410354 | #2540. Build The Grid | Kevin5307 | WA | 0ms | 3628kb | C++23 | 554b | 2024-05-13 21:58:11 | 2024-05-13 21:58:11 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
char grid[505][505];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
grid[i][j]='W';
for(int i=1;i<=n;i++)
{
int len;
if(i==1) len=n-1;
else if(i==2) len=0;
else if(i&1) len=n-i;
else if(i==n&&n%2) len=1;
else len=n-i+2;
for(int j=1;j<=len;j++)
grid[i][n-j]='B';
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
putchar(grid[i][j]);
putchar(10);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3628kb
input:
3
output:
BBW WWW WWW
result:
wrong answer P is not a permutation