結果

問題 No.1974 2x2 Flipper
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-06-10 23:17:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 81,808 KB
実行使用メモリ 85,964 KB
最終ジャッジ日時 2023-10-21 05:43:14
合計ジャッジ時間 5,380 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,400 KB
testcase_01 AC 62 ms
76,392 KB
testcase_02 AC 47 ms
64,308 KB
testcase_03 AC 106 ms
82,000 KB
testcase_04 AC 77 ms
78,400 KB
testcase_05 WA -
testcase_06 AC 96 ms
79,896 KB
testcase_07 AC 87 ms
78,424 KB
testcase_08 AC 61 ms
76,068 KB
testcase_09 AC 92 ms
80,480 KB
testcase_10 WA -
testcase_11 AC 85 ms
79,048 KB
testcase_12 AC 105 ms
81,660 KB
testcase_13 AC 86 ms
79,328 KB
testcase_14 AC 76 ms
77,604 KB
testcase_15 AC 114 ms
83,136 KB
testcase_16 WA -
testcase_17 AC 99 ms
80,820 KB
testcase_18 AC 56 ms
75,988 KB
testcase_19 AC 61 ms
76,224 KB
testcase_20 AC 78 ms
78,200 KB
testcase_21 AC 129 ms
85,404 KB
testcase_22 AC 130 ms
85,768 KB
testcase_23 AC 132 ms
85,728 KB
testcase_24 WA -
testcase_25 AC 33 ms
53,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w = map(int,input().split())

ans = [[0]*w for i in range(h)]

if h == 1 or w == 1:
    print(0)
    for i in ans:
        print(*i)
    exit()


for i in range(0,h,2):
    for j in range(0,w,2):
        if i+1 < h and j+1 < w:
            ans[i][j] = ans[i+1][j] = ans[i][j+1] = ans[i+1][j+1] = 1

num = 0
for i in range(2):
    for j in range(2):
        num += ans[-1-i][-1-j]

if num == 1:
    for i in range(2):
        for j in range(2):
            ans[-1-i][-1-j] ^= 1

num = 0
for i in ans:
    num += sum(i)
print(num)
for i in ans:
    print(*i)
0