結果

問題 No.2432 Flip and Move
ユーザー tassei903tassei903
提出日時 2023-08-11 22:17:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 633 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 163,328 KB
最終ジャッジ日時 2024-05-06 02:09:59
合計ジャッジ時間 11,889 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,096 KB
testcase_01 AC 42 ms
51,712 KB
testcase_02 AC 133 ms
72,576 KB
testcase_03 AC 633 ms
163,328 KB
testcase_04 AC 215 ms
83,328 KB
testcase_05 AC 76 ms
71,168 KB
testcase_06 AC 153 ms
69,632 KB
testcase_07 AC 476 ms
132,608 KB
testcase_08 AC 414 ms
134,912 KB
testcase_09 AC 572 ms
160,512 KB
testcase_10 AC 108 ms
68,864 KB
testcase_11 AC 146 ms
69,760 KB
testcase_12 AC 102 ms
67,968 KB
testcase_13 AC 86 ms
68,864 KB
testcase_14 AC 228 ms
95,488 KB
testcase_15 AC 500 ms
143,360 KB
testcase_16 AC 210 ms
69,760 KB
testcase_17 AC 433 ms
83,200 KB
testcase_18 AC 146 ms
78,336 KB
testcase_19 AC 232 ms
81,792 KB
testcase_20 AC 321 ms
84,864 KB
testcase_21 AC 300 ms
81,280 KB
testcase_22 AC 333 ms
71,552 KB
testcase_23 AC 131 ms
78,848 KB
testcase_24 AC 465 ms
82,688 KB
testcase_25 AC 377 ms
81,280 KB
testcase_26 AC 188 ms
82,816 KB
testcase_27 AC 71 ms
64,896 KB
testcase_28 AC 66 ms
63,744 KB
testcase_29 AC 303 ms
73,344 KB
testcase_30 AC 162 ms
83,584 KB
testcase_31 AC 373 ms
81,152 KB
testcase_32 AC 71 ms
63,616 KB
testcase_33 AC 176 ms
83,072 KB
testcase_34 AC 179 ms
71,040 KB
testcase_35 AC 208 ms
81,152 KB
testcase_36 AC 45 ms
51,584 KB
testcase_37 AC 44 ms
51,840 KB
testcase_38 AC 43 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
k = int(input()) % (8 * h * w)

x,y = 0,0
dx,dy = 1,1

s = [["." for j in range(w)] for i in range(h)]

for _ in range(k):
    if s[x][y] == ".":
        s[x][y] = "#"
    else:
        s[x][y] = "."

    if x + dx < 0 or x + dx >= h:
        dx *= -1
    else:
        x += dx
    if y + dy < 0 or y + dy >= w:
        dy *= -1
    else:
        y += dy

for i in s:
    print("".join(i))
0