QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#218751#6743. water235skkyk#WA 0ms3880kbC++141.2kb2023-10-18 17:57:212023-10-18 17:57:21

Judging History

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

  • [2023-10-18 17:57:21]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3880kb
  • [2023-10-18 17:57:21]
  • 提交

answer

#include<bits/stdc++.h>
#define For(x,n) for(int i = 1; i <= n; i++)
using namespace std;
int read() {
    int sum = 0 , w = 1 ; char c = getchar();
    while( c < '0' || c > '9') {
        if(c == '-') w = -1;
        c = getchar();}
    while(c >= '0' && c <= '9') {
        sum = sum * 10 + c - '0';
        c = getchar();}
    return sum * w;
}

int main() {
	int n = read(), m = read();
	if((n + m) % 2) cout<<(n + m) /2 + 1<<'\n';
	else cout<<(n +  m) / 2<<'\n';
	for(int i = 1; i <= m; i++) 
		if(i % 2) printf("1");
		else printf("0");
	puts("");
	int js = 0;
	if(m % 2) js = 1;
	for(int i = 2; i < n; i++) {
		for(int j = 1; j < m; j++) {
			printf("0");
		}
		printf("%d", js ^= 1);
		puts("");
	}
	for(int j = 1; j < m; j++) printf("0");
	if((n + m) % 2) cout<<1<<'\n';
	else cout<<(js ^ 1);
	return 0;
}
/*
pika へ          /|
  /\7    ∠_/
  / │   / /
 │ Z _,< /   /`ヽ
 │ヽ   /  〉
  Y`     / /     |\
 /	●  ● / /  〈 \
 ()  へ   |  \〈
  >> __ <  │ //
  / へ  / <<| \\
  ヽ_) (_/  │//
  7|/		| / /
  >―r ̄ ̄`?―_6
*/


Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 1

output:

2
1
1

result:

ok The answer is correct.

Test #2:

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

input:

3 3

output:

3
101
000
001

result:

wrong answer Integer 101 violates the range [0, 1]