QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#24590#2553. BingoyuyueWA 4ms3716kbC++171.1kb2022-04-01 12:07:022022-04-30 06:15:28

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-04-30 06:15:28]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:3716kb
  • [2022-04-01 12:07:02]
  • 提交

answer

#include<bits/stdc++.h>
#define LL long long
#define pb push_back
#define SZ(x) ((int)x.size()-1)
#define ms(a,b) memset(a,b,sizeof a)
#define F(i,a,b) for (int i=(a);i<=(b);++i)
#define DF(i,a,b) for (int i=(a);i>=(b);--i)
//#define mp make_pair
//#define OO(x) fixed<<setprecision(x)
using namespace std;
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline int read(){
	char ch=getchar(); int w=1,c=0;
	for(;!isdigit(ch);ch=getchar()) if (ch=='-') w=-1;
	for(;isdigit(ch);ch=getchar()) c=(c<<1)+(c<<3)+(ch^48);
	return w*c;
}
const int M=2020;
int n,k; 
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	n=read(); k=read();
	if (k<=n*(n-1) && n>2 || k<n) cout<<"YES\n";
	else{
		cout<<"NO\n";
		return 0;
	}
	F(i,1,n){
		F(j,1,n){
			if (i^j && k) cout<<"#",k--;
			else cout<<".";
		}
		cout<<"\n";
	} 
	return 0;
}
/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
*/

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 3660kb

input:

4 2

output:

YES
.##.
....
....
....

result:

ok n=4, k=2

Test #2:

score: 0
Accepted
time: 0ms
memory: 3564kb

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: 1ms
memory: 3648kb

input:

3 0

output:

YES
...
...
...

result:

ok n=3, k=0

Test #5:

score: 0
Accepted
time: 1ms
memory: 3576kb

input:

3 2

output:

YES
.##
...
...

result:

ok n=3, k=2

Test #6:

score: 0
Accepted
time: 3ms
memory: 3528kb

input:

5 4

output:

YES
.####
.....
.....
.....
.....

result:

ok n=5, k=4

Test #7:

score: 0
Accepted
time: 3ms
memory: 3512kb

input:

25 20

output:

YES
.####################....
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.........................
.............

result:

ok n=25, k=20

Test #8:

score: 0
Accepted
time: 4ms
memory: 3528kb

input:

31 29

output:

YES
.#############################.
...............................
...............................
...............................
...............................
...............................
...............................
...............................
...............................
...........

result:

ok n=31, k=29

Test #9:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

44 10

output:

YES
.##########.................................
............................................
............................................
............................................
............................................
............................................
.............................

result:

ok n=44, k=10

Test #10:

score: 0
Accepted
time: 3ms
memory: 3536kb

input:

44 22

output:

YES
.######################.....................
............................................
............................................
............................................
............................................
............................................
.............................

result:

ok n=44, k=22

Test #11:

score: 0
Accepted
time: 3ms
memory: 3564kb

input:

100 0

output:

YES
....................................................................................................
....................................................................................................
.................................................................................................

result:

ok n=100, k=0

Test #12:

score: 0
Accepted
time: 1ms
memory: 3664kb

input:

100 1

output:

YES
.#..................................................................................................
....................................................................................................
.................................................................................................

result:

ok n=100, k=1

Test #13:

score: 0
Accepted
time: 3ms
memory: 3560kb

input:

100 2

output:

YES
.##.................................................................................................
....................................................................................................
.................................................................................................

result:

ok n=100, k=2

Test #14:

score: 0
Accepted
time: 3ms
memory: 3644kb

input:

100 50

output:

YES
.##################################################.................................................
....................................................................................................
.................................................................................................

result:

ok n=100, k=50

Test #15:

score: 0
Accepted
time: 1ms
memory: 3444kb

input:

100 98

output:

YES
.##################################################################################################.
....................................................................................................
.................................................................................................

result:

ok n=100, k=98

Test #16:

score: 0
Accepted
time: 3ms
memory: 3588kb

input:

100 99

output:

YES
.###################################################################################################
....................................................................................................
.................................................................................................

result:

ok n=100, k=99

Test #17:

score: 0
Accepted
time: 3ms
memory: 3448kb

input:

99 97

output:

YES
.#################################################################################################.
...................................................................................................
...................................................................................................

result:

ok n=99, k=97

Test #18:

score: 0
Accepted
time: 3ms
memory: 3524kb

input:

99 98

output:

YES
.##################################################################################################
...................................................................................................
...................................................................................................

result:

ok n=99, k=98

Test #19:

score: 0
Accepted
time: 3ms
memory: 3660kb

input:

1 0

output:

YES
.

result:

ok n=1, k=0

Test #20:

score: 0
Accepted
time: 3ms
memory: 3584kb

input:

1 1

output:

NO

result:

ok n=1, k=1

Test #21:

score: 0
Accepted
time: 3ms
memory: 3568kb

input:

2 0

output:

YES
..
..

result:

ok n=2, k=0

Test #22:

score: 0
Accepted
time: 2ms
memory: 3448kb

input:

2 1

output:

YES
.#
..

result:

ok n=2, k=1

Test #23:

score: 0
Accepted
time: 1ms
memory: 3552kb

input:

2 2

output:

NO

result:

ok n=2, k=2

Test #24:

score: 0
Accepted
time: 3ms
memory: 3516kb

input:

2 3

output:

NO

result:

ok n=2, k=3

Test #25:

score: 0
Accepted
time: 3ms
memory: 3716kb

input:

2 4

output:

NO

result:

ok n=2, k=4

Test #26:

score: 0
Accepted
time: 3ms
memory: 3640kb

input:

3 0

output:

YES
...
...
...

result:

ok n=3, k=0

Test #27:

score: 0
Accepted
time: 3ms
memory: 3588kb

input:

3 1

output:

YES
.#.
...
...

result:

ok n=3, k=1

Test #28:

score: 0
Accepted
time: 3ms
memory: 3640kb

input:

3 3

output:

YES
.##
#..
...

result:

ok n=3, k=3

Test #29:

score: 0
Accepted
time: 2ms
memory: 3528kb

input:

3 5

output:

YES
.##
#.#
#..

result:

ok n=3, k=5

Test #30:

score: 0
Accepted
time: 2ms
memory: 3448kb

input:

3 6

output:

YES
.##
#.#
##.

result:

ok n=3, k=6

Test #31:

score: 0
Accepted
time: 1ms
memory: 3644kb

input:

3 7

output:

NO

result:

ok n=3, k=7

Test #32:

score: 0
Accepted
time: 2ms
memory: 3536kb

input:

3 8

output:

NO

result:

ok n=3, k=8

Test #33:

score: 0
Accepted
time: 2ms
memory: 3564kb

input:

3 9

output:

NO

result:

ok n=3, k=9

Test #34:

score: 0
Accepted
time: 2ms
memory: 3448kb

input:

4 0

output:

YES
....
....
....
....

result:

ok n=4, k=0

Test #35:

score: 0
Accepted
time: 3ms
memory: 3580kb

input:

4 3

output:

YES
.###
....
....
....

result:

ok n=4, k=3

Test #36:

score: 0
Accepted
time: 2ms
memory: 3560kb

input:

4 4

output:

YES
.###
#...
....
....

result:

ok n=4, k=4

Test #37:

score: 0
Accepted
time: 3ms
memory: 3564kb

input:

4 5

output:

YES
.###
#.#.
....
....

result:

ok n=4, k=5

Test #38:

score: 0
Accepted
time: 2ms
memory: 3576kb

input:

4 16

output:

NO

result:

ok n=4, k=16

Test #39:

score: 0
Accepted
time: 1ms
memory: 3648kb

input:

4 9

output:

YES
.###
#.##
##.#
....

result:

ok n=4, k=9

Test #40:

score: -100
Wrong Answer
time: 1ms
memory: 3524kb

input:

4 10

output:

YES
.###
#.##
##.#
#...

result:

wrong answer bingo line at diagonal