結果

問題 No.2432 Flip and Move
ユーザー Akijin_007Akijin_007
提出日時 2023-08-18 22:41:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 528 ms / 2,000 ms
コード長 661 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 207,104 KB
最終ジャッジ日時 2024-05-06 05:02:50
合計ジャッジ時間 8,649 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,840 KB
testcase_01 AC 37 ms
52,096 KB
testcase_02 AC 122 ms
91,392 KB
testcase_03 AC 528 ms
207,104 KB
testcase_04 AC 104 ms
88,576 KB
testcase_05 AC 100 ms
88,704 KB
testcase_06 AC 95 ms
86,400 KB
testcase_07 AC 370 ms
161,664 KB
testcase_08 AC 369 ms
168,320 KB
testcase_09 AC 510 ms
203,268 KB
testcase_10 AC 101 ms
85,760 KB
testcase_11 AC 115 ms
87,296 KB
testcase_12 AC 96 ms
84,480 KB
testcase_13 AC 104 ms
87,292 KB
testcase_14 AC 168 ms
107,264 KB
testcase_15 AC 426 ms
185,180 KB
testcase_16 AC 103 ms
79,616 KB
testcase_17 AC 131 ms
87,512 KB
testcase_18 AC 88 ms
79,104 KB
testcase_19 AC 132 ms
85,628 KB
testcase_20 AC 143 ms
91,432 KB
testcase_21 AC 135 ms
85,424 KB
testcase_22 AC 105 ms
86,520 KB
testcase_23 AC 91 ms
79,232 KB
testcase_24 AC 122 ms
86,996 KB
testcase_25 AC 120 ms
85,632 KB
testcase_26 AC 133 ms
89,856 KB
testcase_27 AC 59 ms
69,888 KB
testcase_28 AC 64 ms
71,040 KB
testcase_29 AC 137 ms
85,444 KB
testcase_30 AC 140 ms
87,296 KB
testcase_31 AC 110 ms
85,804 KB
testcase_32 AC 59 ms
69,248 KB
testcase_33 AC 148 ms
87,424 KB
testcase_34 AC 98 ms
79,944 KB
testcase_35 AC 104 ms
85,760 KB
testcase_36 AC 35 ms
52,224 KB
testcase_37 AC 35 ms
52,480 KB
testcase_38 AC 36 ms
52,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

H, W = map(int, input().split())
K = int(input())

from math import gcd
N = 2 * H * W // gcd(H, W)

K %= N

ans = [[0] * W for i in range(H)]
for i in range(K):
    ux, vx = divmod(i, 2*H)
    uy, vy = divmod(i, 2*W)
    # if ux % 2 == 1:
    #     vx = 2*H - vx
    # if uy % 2 == 1:
    #     vy = 2*W - vy
    vx = min(vx, 2*H-vx-1)
    vy = min(vy, 2*W-vy-1)
    # print(H, W, vx, vy)

    ans[vx][vy] += 1

for i in range(H):
    for j in range(W):
        if ans[i][j] % 2 == 0:
            ans[i][j] = "."
        else:
            ans[i][j] = "#"
    print("".join(ans[i]))




0