結果

問題 No.1974 2x2 Flipper
ユーザー hir355hir355
提出日時 2022-06-10 22:26:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 470 bytes
コンパイル時間 813 ms
コンパイル使用メモリ 81,648 KB
実行使用メモリ 85,572 KB
最終ジャッジ日時 2023-10-21 05:26:00
合計ジャッジ時間 6,230 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,424 KB
testcase_01 AC 72 ms
76,564 KB
testcase_02 AC 52 ms
64,324 KB
testcase_03 AC 124 ms
81,916 KB
testcase_04 AC 90 ms
78,340 KB
testcase_05 WA -
testcase_06 AC 104 ms
79,920 KB
testcase_07 AC 91 ms
78,536 KB
testcase_08 AC 62 ms
74,184 KB
testcase_09 AC 108 ms
80,352 KB
testcase_10 WA -
testcase_11 AC 95 ms
79,004 KB
testcase_12 AC 123 ms
82,080 KB
testcase_13 AC 97 ms
79,376 KB
testcase_14 AC 81 ms
77,720 KB
testcase_15 AC 133 ms
83,188 KB
testcase_16 WA -
testcase_17 AC 114 ms
80,912 KB
testcase_18 AC 56 ms
73,188 KB
testcase_19 AC 68 ms
76,180 KB
testcase_20 AC 88 ms
78,304 KB
testcase_21 AC 157 ms
85,568 KB
testcase_22 AC 155 ms
85,572 KB
testcase_23 AC 154 ms
85,452 KB
testcase_24 WA -
testcase_25 AC 39 ms
53,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
if n == 1 or m == 1:
    ans = [[0] * m for _ in range(n)]
    print(0)
    for row in ans:
        print(*row)
    exit(0)
x = n // 2 * 2
y = m // 2 * 2
ans = [[0] * m for _ in range(n)]
for i in range(x):
    for j in range(y):
        ans[i][j] = 1
if n % 2 == 1 and m % 2 == 1:
    print(x * y + 2)
    ans[-1][-1] = 1
    ans[-1][-2] = 1
    ans[-2][-1] = 1
    ans[-2][-2] = 0
else:
    print(x * y)
for row in ans:
    print(*row)
0