結果

問題 No.2432 Flip and Move
ユーザー rlangevinrlangevin
提出日時 2023-09-18 16:04:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 434 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 184,232 KB
最終ジャッジ日時 2023-09-18 16:04:41
合計ジャッジ時間 10,815 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,316 KB
testcase_01 AC 71 ms
71,180 KB
testcase_02 AC 248 ms
184,232 KB
testcase_03 AC 434 ms
161,988 KB
testcase_04 AC 177 ms
88,872 KB
testcase_05 AC 180 ms
88,772 KB
testcase_06 AC 199 ms
118,492 KB
testcase_07 AC 304 ms
133,120 KB
testcase_08 AC 314 ms
137,676 KB
testcase_09 AC 390 ms
159,316 KB
testcase_10 AC 195 ms
144,324 KB
testcase_11 AC 230 ms
152,788 KB
testcase_12 AC 192 ms
135,712 KB
testcase_13 AC 246 ms
130,932 KB
testcase_14 AC 174 ms
97,484 KB
testcase_15 AC 332 ms
147,524 KB
testcase_16 AC 163 ms
82,948 KB
testcase_17 AC 215 ms
87,840 KB
testcase_18 AC 143 ms
81,916 KB
testcase_19 AC 207 ms
86,656 KB
testcase_20 AC 211 ms
89,308 KB
testcase_21 AC 209 ms
86,560 KB
testcase_22 AC 167 ms
87,388 KB
testcase_23 AC 140 ms
80,504 KB
testcase_24 AC 210 ms
88,088 KB
testcase_25 AC 182 ms
85,544 KB
testcase_26 AC 201 ms
87,200 KB
testcase_27 AC 110 ms
78,436 KB
testcase_28 AC 111 ms
77,848 KB
testcase_29 AC 199 ms
85,732 KB
testcase_30 AC 219 ms
88,356 KB
testcase_31 AC 183 ms
86,644 KB
testcase_32 AC 106 ms
78,744 KB
testcase_33 AC 226 ms
88,076 KB
testcase_34 AC 164 ms
83,512 KB
testcase_35 AC 169 ms
85,920 KB
testcase_36 AC 72 ms
71,544 KB
testcase_37 AC 71 ms
71,272 KB
testcase_38 AC 72 ms
71,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

H, W = map(int, input().split())
K = int(input())
lcm = H * W // gcd(H, W)
K %= 2 * lcm
x, y = 0, 0
G = [[0] * W for i in range(H)]

def plot(G, x, y):
    x %= 2 * H
    y %= 2 * W
    if x >= H:
        x = 2 * H - 1 - x
    if y >= W:
        y = 2 * W - 1 - y
    G[x][y] = 1 - G[x][y]

for _ in range(K):
    plot(G, x, y)
    x, y = x + 1, y + 1
    
def f(c):
    return "#" if c else "."

for i in range(H):
    ans = list(map(f, G[i]))
    print(*ans, sep="")
0