QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#104931 | #6309. Aqre | jeffqi | WA | 2ms | 3596kb | C++23 | 1.2kb | 2023-05-12 15:34:32 | 2023-05-12 15:34:37 |
Judging History
answer
#include<bits/stdc++.h>
#define rep(i,a,b) for (int i = (a); i <= (b); ++i)
#define drep(i,a,b) for (int i = (a); i >= (b); --i)
#define LL long long
#define pii pair<int,int>
#define pll pair<LL,LL>
#define fi first
#define se second
#define mp make_pair
#define eb emplace_back
#define all(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
using namespace std;
LL read() {
LL x = 0,y = 1; char ch = getchar(); while (!isdigit(ch)) {if (ch == '-') y = -y; ch = getchar();}
while (isdigit(ch)) {x = x*10+ch-'0'; ch = getchar();} return x*y;
}
const int tst = 0,rd = 1; int getflg = 0;
namespace qiqi {
const int N = 1e3+5; int n,m,rev,a[N][N];
void main() {
int ans = 0;
n = read(); m = read();
if (m < n) {
rev = 1; swap(n,m);
}
if (n < 4) {
rep(i,1,n) rep(j,1,m) {
ans += a[i][j] = (i != 2 || j%4 != 2) && (i != 1 || j%4) && (i != 3 || j%4);
}
}
else {
rep(i,1,n) rep(j,1,m) {
ans += a[i][j] = i%4 != j%4;
}
}
printf("%d\n",ans);
if (!rev) {
rep(i,1,n) {
rep(j,1,m) printf("%d",a[i][j]); puts("");
}
}
else {
rep(j,1,m) {
rep(i,1,n) printf("%d",a[i][j]); puts("");
}
}
}
}
int main() {
int T = read(); while (T--) qiqi::main(); return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3596kb
input:
3 2 2 3 4 3 8
output:
3 11 10 9 1110 1011 1110 18 11101110 10111011 11101110
result:
wrong answer ans finds a larger answer (test case 1)