結果

問題 No.2112 All 2x2 are Equal
ユーザー 👑 ygussanyygussany
提出日時 2022-10-28 21:53:15
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 1,142 ms
コンパイル使用メモリ 29,116 KB
実行使用メモリ 5,748 KB
最終ジャッジ日時 2023-09-20 04:47:59
合計ジャッジ時間 6,650 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 36 ms
4,840 KB
testcase_05 AC 46 ms
4,940 KB
testcase_06 AC 80 ms
5,392 KB
testcase_07 AC 26 ms
4,596 KB
testcase_08 AC 65 ms
5,584 KB
testcase_09 AC 5 ms
4,376 KB
testcase_10 AC 30 ms
4,384 KB
testcase_11 AC 20 ms
4,380 KB
testcase_12 AC 24 ms
4,812 KB
testcase_13 AC 69 ms
5,288 KB
testcase_14 AC 4 ms
4,380 KB
testcase_15 AC 51 ms
4,792 KB
testcase_16 AC 1 ms
4,384 KB
testcase_17 AC 63 ms
5,008 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 6 ms
4,380 KB
testcase_20 AC 3 ms
5,036 KB
testcase_21 AC 61 ms
4,816 KB
testcase_22 AC 4 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 8 ms
4,376 KB
testcase_25 AC 10 ms
4,380 KB
testcase_26 AC 8 ms
4,376 KB
testcase_27 AC 16 ms
4,376 KB
testcase_28 AC 39 ms
5,172 KB
testcase_29 AC 7 ms
5,252 KB
testcase_30 AC 25 ms
4,452 KB
testcase_31 AC 49 ms
5,496 KB
testcase_32 AC 87 ms
5,592 KB
testcase_33 AC 87 ms
5,588 KB
testcase_34 AC 86 ms
5,640 KB
testcase_35 AC 86 ms
5,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main()
{
	int H, W;
	scanf("%d %d", &H, &W);
	printf("Yes\n");
	
	int i, j, k, ans[1001][1001];
	for (i = 1, k = 1; i <= H; i++) for (j = 2 - i % 2; j <= W; j += 2) ans[i][j] = k++;
	for (i = 1, k = H * W; i <= H; i++) for (j = i % 2 + 1; j <= W; j += 2) ans[i][j] = k--;
	for (i = 1; i <= H; i++) {
		for (j = 1; j <= W; j++) printf("%d ", ans[i][j]);
		printf("\n");
	}
	fflush(stdout);
	return 0;
}
0