QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#104926#6309. AqrejeffqiWA 2ms3496kbC++231.1kb2023-05-12 15:28:542023-05-12 15:28:58

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-12 15:28:58]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3496kb
  • [2023-05-12 15:28:54]
  • 提交

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() {
		n = read(); m = read();
		if (m < n) {
			rev = 1; swap(n,m);
		}
		if (n < 4) {
			rep(i,1,n) rep(j,1,m) {
				a[i][j] = (j-1)%4 < 3;
			}
		}
		else {
			rep(i,1,n) rep(j,1,m) {
				a[i][j] = i%4 != j%4;
			}
		}
		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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3496kb

input:

3
2 2
3 4
3 8

output:

1 1 
1 1 
1 1 1 0 
1 1 1 0 
1 1 1 0 
1 1 1 0 1 1 1 0 
1 1 1 0 1 1 1 0 
1 1 1 0 1 1 1 0 

result:

wrong answer Length must be equal to m (test case 1)