結果

問題 No.2112 All 2x2 are Equal
ユーザー タコイモタコイモ
提出日時 2022-10-28 23:01:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 641 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 94,332 KB
最終ジャッジ日時 2023-09-20 06:14:17
合計ジャッジ時間 10,560 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,388 KB
testcase_01 AC 78 ms
71,244 KB
testcase_02 AC 95 ms
76,856 KB
testcase_03 AC 94 ms
76,720 KB
testcase_04 WA -
testcase_05 AC 165 ms
86,048 KB
testcase_06 AC 208 ms
93,784 KB
testcase_07 AC 133 ms
81,884 KB
testcase_08 AC 185 ms
90,216 KB
testcase_09 WA -
testcase_10 AC 139 ms
82,956 KB
testcase_11 AC 121 ms
80,968 KB
testcase_12 WA -
testcase_13 AC 198 ms
90,752 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 85 ms
76,528 KB
testcase_17 AC 184 ms
89,492 KB
testcase_18 AC 93 ms
76,728 KB
testcase_19 AC 100 ms
78,340 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 94 ms
76,728 KB
testcase_24 AC 110 ms
78,704 KB
testcase_25 AC 113 ms
78,824 KB
testcase_26 AC 103 ms
78,392 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 114 ms
78,528 KB
testcase_30 AC 129 ms
81,900 KB
testcase_31 AC 163 ms
86,480 KB
testcase_32 AC 222 ms
93,716 KB
testcase_33 AC 236 ms
93,412 KB
testcase_34 WA -
testcase_35 AC 212 ms
93,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W= map(int,input().split())
print('Yes')
K = [i for i in range(1,H*W+1)]
S = 1+H*W
count = 1
co = H*W
ans = [[0]*W for _ in range(H)]
ans[0][0] = 1
for i in range(H//2):
  for j in range(W):
    if j % 2 == 0:
      ans[2*i][j] = count
      ans[2*i+1][j] = co
      count += 1
      co -= 1
    else:
      ans[2*i][j] = co
      ans[2*i+1][j] = count
      count += 1
      co -= 1
  print(*ans[2*i])
  print(*ans[2*i+1])
if H % 2 == 1:
  D = ans[-2][0]+ans[-2][1]
  ans[-1][0] = count
  for j in range(1,W):
    if j % 2 == 0:
      
      ans[-1][j] = D-ans[-1][j-1] 
    else:
      ans[-1][j] = D-ans[-1][j-1]-2
  print(*ans[-1])
  
0