結果

問題 No.2228 Creeping Ghost
ユーザー lloyzlloyz
提出日時 2023-12-30 01:20:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 866 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 149,792 KB
最終ジャッジ日時 2023-12-30 01:20:16
合計ジャッジ時間 2,501 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 35 ms
53,460 KB
testcase_05 AC 138 ms
149,792 KB
testcase_06 AC 106 ms
110,008 KB
testcase_07 AC 142 ms
149,792 KB
testcase_08 AC 137 ms
149,792 KB
testcase_09 AC 107 ms
110,136 KB
testcase_10 AC 107 ms
110,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())

q = -1
ANS = []
for i in range(t):
    r = i % 4
    if r == 0:
        if q <= 2:
            ANS.append('R')
        elif q == 3 or q == 7:
            ANS.append('U')
        else:
            ANS.append('L')
    elif r == 1:
        if q <= 2:
            ANS.append('L')
        elif q == 3 or q == 7:
            ANS.append('U')
        else:
            ANS.append('R')
    elif r == 2:
        if q <= 2:
            ANS.append('R')
        elif q == 3 or q == 7:
            ANS.append('D')
        else:
            ANS.append('L')
    else:
        if q <= 1:
            ANS.append('D')
        elif q == 2 or q == 6:
            ANS.append('U')
        elif q == 3:
            ANS.append('L')
        elif q == 7:
            ANS.append('R')
        else:
            ANS.append('D')
        q += 1
        q %= 8
print(''.join(ANS))
0