結果
問題 |
No.2112 All 2x2 are Equal
|
ユーザー |
|
提出日時 | 2022-10-28 22:39:03 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 589 bytes |
コンパイル時間 | 376 ms |
コンパイル使用メモリ | 82,028 KB |
実行使用メモリ | 84,608 KB |
最終ジャッジ日時 | 2024-07-06 01:51:14 |
合計ジャッジ時間 | 6,058 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 WA * 17 |
ソースコード
h,w = map(int,input().split()) ans = [[0]*(w) for i in range(h)] now = 1 for i in range(h): for j in range(w): tmp = i*w+j if tmp % 2 == 0: ans[i][j] = now now += 1 for i in range(h)[::-1]: for j in range(w)[::-1]: tmp = i*w+j if tmp % 2 == 1: ans[i][j] = now now += 1 flg = True s = ans[0][0] + ans[0][1] + ans[1][0] + ans[1][1] for i in range(h-1): for j in range(w-1): if ans[i][j] +ans[i+1][j] +ans[i][j+1] +ans[i+1][j+1] == s: continue flg = False if flg: print('Yes') for i in ans: print(*i) else: print('No')