QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#218678#6743. water235Berlin_JacorWA 1ms3688kbC++14525b2023-10-18 16:50:372023-10-18 16:50:37

Judging History

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

  • [2023-10-18 16:50:37]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3688kb
  • [2023-10-18 16:50:37]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod = 998244353;
signed main() {
	int n,m;
	cin>>n>>m;
	cout<<min(n,m) + (max(n,m)-min(n,m)+1)/2<<"\n";
	for(int i=1;i<=n;++i) {
		for(int j=1;j<=m;++j) {
			if(i==j) {
				cout<<"1 ";
			}
			else if(j<=min(n,m)&&i<=min(n,m)) {
				cout<<"0 ";
			}
			else if((i==1&&(((j & min(n,m) & 1) == 1)||j==max(n,m)))||(j==1&&(((i & min(n,m) & 1)== 1)||i==max(n,m)))) {
				cout<<"1 ";
			}
			else cout<<"0 ";
		}
		cout<<"\n";
	}
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3596kb

input:

2 1

output:

2
1 
1 

result:

ok The answer is correct.

Test #2:

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

input:

3 3

output:

3
1 0 0 
0 1 0 
0 0 1 

result:

ok The answer is correct.

Test #3:

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

input:

1 4

output:

3
1 0 1 1 

result:

ok The answer is correct.

Test #4:

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

input:

2 2

output:

2
1 0 
0 1 

result:

ok The answer is correct.

Test #5:

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

input:

2 4

output:

3
1 0 0 1 
0 1 0 0 

result:

ok The answer is correct.

Test #6:

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

input:

4 3

output:

4
1 0 0 
0 1 0 
0 0 1 
1 0 0 

result:

ok The answer is correct.

Test #7:

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

input:

4 4

output:

4
1 0 0 0 
0 1 0 0 
0 0 1 0 
0 0 0 1 

result:

ok The answer is correct.

Test #8:

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

input:

1 789

output:

395
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

result:

ok The answer is correct.

Test #9:

score: -100
Wrong Answer
time: 0ms
memory: 3588kb

input:

2 444

output:

223
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

wrong answer Invalid output