QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#43784 | #2553. Bingo | Ufowoqqqo | WA | 2ms | 3712kb | C++ | 994b | 2022-08-10 23:14:23 | 2022-08-10 23:16:47 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
char s[N][N];
int main()
{
int n, k;
int i, j;
scanf("%d%d", &n, &k);
if(n == 2)
{
if(k > 1)
puts("NO");
else
{
puts("YES");
puts("#.");
puts("..");
}
return 0;
}
if(k > n * (n - 1))
puts("NO");
else
{
puts("YES");
for(i = 0; i < n; i ++)
for(j = 0; j < n; j ++)
s[i][j] = '#';
s[0][0] = s[n - 1][n - 1] = '.';
for(i = 1; i + 1 < n; i ++)
s[i][n - i - 1] = '.';
for(i = 0; i < n; i ++)
for(j = 0; j < n; j ++)
if(s[i][j] == '#')
if(k > 0)
k --;
else
s[i][j] = '.';
for(i = 0; i < n; i ++)
puts(s[i]);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3712kb
input:
4 2
output:
YES .##. .... .... ....
result:
ok n=4, k=2
Test #2:
score: 0
Accepted
time: 2ms
memory: 3516kb
input:
4 16
output:
NO
result:
ok n=4, k=16
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3632kb
input:
2 0
output:
YES #. ..
result:
wrong answer 1 filled cells instead of 0