結果

問題 No.1974 2x2 Flipper
ユーザー ygd.ygd.
提出日時 2022-06-10 23:00:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,204 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 85,400 KB
最終ジャッジ日時 2023-10-21 05:38:23
合計ジャッジ時間 5,869 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,312 KB
testcase_01 AC 74 ms
76,356 KB
testcase_02 AC 55 ms
64,040 KB
testcase_03 AC 131 ms
82,016 KB
testcase_04 AC 96 ms
78,192 KB
testcase_05 AC 76 ms
77,088 KB
testcase_06 AC 111 ms
79,676 KB
testcase_07 AC 95 ms
78,332 KB
testcase_08 AC 67 ms
75,864 KB
testcase_09 AC 111 ms
80,100 KB
testcase_10 WA -
testcase_11 AC 102 ms
78,960 KB
testcase_12 AC 128 ms
81,792 KB
testcase_13 AC 102 ms
79,156 KB
testcase_14 AC 84 ms
77,512 KB
testcase_15 AC 137 ms
82,884 KB
testcase_16 AC 65 ms
75,896 KB
testcase_17 AC 117 ms
80,656 KB
testcase_18 AC 59 ms
73,372 KB
testcase_19 AC 67 ms
75,976 KB
testcase_20 AC 90 ms
78,096 KB
testcase_21 AC 159 ms
85,400 KB
testcase_22 AC 158 ms
85,260 KB
testcase_23 AC 160 ms
85,280 KB
testcase_24 AC 158 ms
85,340 KB
testcase_25 AC 40 ms
53,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]
#dx8 = [1,1,0,-1,-1,-1,0,1]
#dy8 = [0,1,1,1,0,-1,-1,-1]


def main():
    H,W = map(int,input().split())
    
    if H%2 == 0 or W%2 == 0:
        A = [[0]*W for _ in range(H)]
        for i in range((H//2)*2):
            for j in range((W//2)*2):
                A[i][j] = 1
    else:
        A = [[1]*W for _ in range(H)]
        for i in range(min(H,W)):
            A[i][i] = 0
        if H > W:
            for i in range(W,H):
                print(i,W-1)
                A[i][W-1] = 0
        else:
            for i in range(H,W):
                A[H-1][i] = 0

    ans = 0
    for i in range(H):
        for j in range(W):
            ans += A[i][j]
    print(ans)
    for i in range(H):
        print(*A[i])



if __name__ == '__main__':
    main()
0