QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#43783 | #2553. Bingo | Ufowoqqqo | WA | 3ms | 3784kb | C++ | 525b | 2022-08-10 22:59:56 | 2022-08-10 22:59:58 |
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(k > (n - 1) * (n - 1))
puts("NO");
else
{
puts("YES");
for(i = 0; i < n; i ++)
for(j = 0; j < n; j ++)
s[i][j] = '.';
for(i = 0; i < k; i ++)
s[i / (n - 1)][i % (n - 1)] = '#';
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: 3ms
memory: 3704kb
input:
4 2
output:
YES ##.. .... .... ....
result:
ok n=4, k=2
Test #2:
score: 0
Accepted
time: 2ms
memory: 3776kb
input:
4 16
output:
NO
result:
ok n=4, k=16
Test #3:
score: 0
Accepted
time: 2ms
memory: 3640kb
input:
2 0
output:
YES .. ..
result:
ok n=2, k=0
Test #4:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
3 0
output:
YES ... ... ...
result:
ok n=3, k=0
Test #5:
score: 0
Accepted
time: 2ms
memory: 3624kb
input:
3 2
output:
YES ##. ... ...
result:
ok n=3, k=2
Test #6:
score: 0
Accepted
time: 2ms
memory: 3736kb
input:
5 4
output:
YES ####. ..... ..... ..... .....
result:
ok n=5, k=4
Test #7:
score: 0
Accepted
time: 2ms
memory: 3680kb
input:
25 20
output:
YES ####################..... ......................... ......................... ......................... ......................... ......................... ......................... ......................... ......................... ......................... ......................... .............
result:
ok n=25, k=20
Test #8:
score: 0
Accepted
time: 2ms
memory: 3700kb
input:
31 29
output:
YES #############################.. ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... ...........
result:
ok n=31, k=29
Test #9:
score: 0
Accepted
time: 2ms
memory: 3708kb
input:
44 10
output:
YES ##########.................................. ............................................ ............................................ ............................................ ............................................ ............................................ .............................
result:
ok n=44, k=10
Test #10:
score: 0
Accepted
time: 2ms
memory: 3760kb
input:
44 22
output:
YES ######################...................... ............................................ ............................................ ............................................ ............................................ ............................................ .............................
result:
ok n=44, k=22
Test #11:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
100 0
output:
YES .................................................................................................... .................................................................................................... .................................................................................................
result:
ok n=100, k=0
Test #12:
score: 0
Accepted
time: 2ms
memory: 3716kb
input:
100 1
output:
YES #................................................................................................... .................................................................................................... .................................................................................................
result:
ok n=100, k=1
Test #13:
score: 0
Accepted
time: 2ms
memory: 3784kb
input:
100 2
output:
YES ##.................................................................................................. .................................................................................................... .................................................................................................
result:
ok n=100, k=2
Test #14:
score: 0
Accepted
time: 2ms
memory: 3764kb
input:
100 50
output:
YES ##################################################.................................................. .................................................................................................... .................................................................................................
result:
ok n=100, k=50
Test #15:
score: 0
Accepted
time: 2ms
memory: 3772kb
input:
100 98
output:
YES ##################################################################################################.. .................................................................................................... .................................................................................................
result:
ok n=100, k=98
Test #16:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
100 99
output:
YES ###################################################################################################. .................................................................................................... .................................................................................................
result:
ok n=100, k=99
Test #17:
score: 0
Accepted
time: 2ms
memory: 3780kb
input:
99 97
output:
YES #################################################################################################.. ................................................................................................... ...................................................................................................
result:
ok n=99, k=97
Test #18:
score: 0
Accepted
time: 2ms
memory: 3748kb
input:
99 98
output:
YES ##################################################################################################. ................................................................................................... ...................................................................................................
result:
ok n=99, k=98
Test #19:
score: 0
Accepted
time: 2ms
memory: 3772kb
input:
1 0
output:
YES .
result:
ok n=1, k=0
Test #20:
score: 0
Accepted
time: 2ms
memory: 3644kb
input:
1 1
output:
NO
result:
ok n=1, k=1
Test #21:
score: 0
Accepted
time: 2ms
memory: 3628kb
input:
2 0
output:
YES .. ..
result:
ok n=2, k=0
Test #22:
score: 0
Accepted
time: 2ms
memory: 3700kb
input:
2 1
output:
YES #. ..
result:
ok n=2, k=1
Test #23:
score: 0
Accepted
time: 2ms
memory: 3680kb
input:
2 2
output:
NO
result:
ok n=2, k=2
Test #24:
score: 0
Accepted
time: 2ms
memory: 3508kb
input:
2 3
output:
NO
result:
ok n=2, k=3
Test #25:
score: 0
Accepted
time: 2ms
memory: 3712kb
input:
2 4
output:
NO
result:
ok n=2, k=4
Test #26:
score: 0
Accepted
time: 2ms
memory: 3576kb
input:
3 0
output:
YES ... ... ...
result:
ok n=3, k=0
Test #27:
score: 0
Accepted
time: 2ms
memory: 3644kb
input:
3 1
output:
YES #.. ... ...
result:
ok n=3, k=1
Test #28:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
3 3
output:
YES ##. #.. ...
result:
ok n=3, k=3
Test #29:
score: -100
Wrong Answer
time: 2ms
memory: 3684kb
input:
3 5
output:
NO
result:
wrong answer YES/NO differs