結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,456 KB
testcase_01 AC 42 ms
52,352 KB
testcase_02 AC 134 ms
72,832 KB
testcase_03 AC 529 ms
163,200 KB
testcase_04 AC 125 ms
83,328 KB
testcase_05 AC 76 ms
71,424 KB
testcase_06 AC 109 ms
70,016 KB
testcase_07 AC 349 ms
132,608 KB
testcase_08 AC 357 ms
135,040 KB
testcase_09 AC 470 ms
160,128 KB
testcase_10 AC 103 ms
68,864 KB
testcase_11 AC 88 ms
67,584 KB
testcase_12 AC 99 ms
68,224 KB
testcase_13 AC 82 ms
68,736 KB
testcase_14 AC 182 ms
96,000 KB
testcase_15 AC 382 ms
143,360 KB
testcase_16 AC 89 ms
68,608 KB
testcase_17 AC 221 ms
83,456 KB
testcase_18 AC 107 ms
78,464 KB
testcase_19 AC 182 ms
82,304 KB
testcase_20 AC 166 ms
84,608 KB
testcase_21 AC 196 ms
81,408 KB
testcase_22 AC 123 ms
71,040 KB
testcase_23 AC 99 ms
78,720 KB
testcase_24 AC 200 ms
82,560 KB
testcase_25 AC 171 ms
81,408 KB
testcase_26 AC 170 ms
83,456 KB
testcase_27 AC 58 ms
62,208 KB
testcase_28 AC 59 ms
63,616 KB
testcase_29 AC 122 ms
72,576 KB
testcase_30 AC 148 ms
83,712 KB
testcase_31 AC 170 ms
81,024 KB
testcase_32 AC 63 ms
63,488 KB
testcase_33 AC 178 ms
83,072 KB
testcase_34 AC 79 ms
67,328 KB
testcase_35 AC 165 ms
81,792 KB
testcase_36 AC 39 ms
52,224 KB
testcase_37 AC 39 ms
51,584 KB
testcase_38 AC 39 ms
51,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
k = int(input()) % (4 * 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