QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#218751 | #6743. water235 | skkyk# | WA | 0ms | 3880kb | C++14 | 1.2kb | 2023-10-18 17:57:21 | 2023-10-18 17:57:21 |
Judging History
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]