結果

問題 No.2228 Creeping Ghost
ユーザー LyricalMaestro
提出日時 2024-09-19 11:46:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 798 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 187,328 KB
最終ジャッジ日時 2024-09-19 11:46:37
合計ジャッジ時間 2,306 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

# https://yukicoder.me/problems/no/2228

def append(answer, targets):
    for t in targets:
        answer.append(t)

def main():
    T  = int(input())

    # 1回目の移動(1, 1) -> (2, 2)
    answer = [] 
    
    append(answer, ["D", "D", "U", "R"])
    # 2回目の移動(2, 2) -> (3, 3)
    append(answer, ["D", "D", "U", "R"])
    while len(answer) < T:
        # 3回目の移動
        append(answer, ["R", "R", "L", "U"])
        # 4回目の移動
        append(answer, ["R", "U", "L", "L"])
        # 5回目の移動
        append(answer, ["L", "L", "R", "D"])
        # 6回目の移動
        append(answer, ["D", "D", "U", "R"])

    answer0 = []
    for i in range(T):
        answer0.append(answer[i])
    print("".join(answer0))



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