結果

問題 No.1315 渦巻洞穴
ユーザー KudeKude
提出日時 2020-12-12 21:58:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 2,658 bytes
コンパイル時間 225 ms
コンパイル使用メモリ 81,680 KB
実行使用メモリ 98,304 KB
最終ジャッジ日時 2023-10-20 02:40:45
合計ジャッジ時間 8,003 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,496 KB
testcase_01 WA -
testcase_02 AC 38 ms
53,496 KB
testcase_03 AC 37 ms
53,496 KB
testcase_04 AC 38 ms
53,496 KB
testcase_05 AC 38 ms
53,496 KB
testcase_06 WA -
testcase_07 AC 37 ms
53,496 KB
testcase_08 AC 43 ms
53,496 KB
testcase_09 AC 38 ms
53,496 KB
testcase_10 WA -
testcase_11 AC 39 ms
53,496 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 64 ms
80,720 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 62 ms
77,920 KB
testcase_19 AC 66 ms
83,404 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 55 ms
73,536 KB
testcase_23 AC 65 ms
84,708 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 64 ms
85,328 KB
testcase_27 AC 68 ms
85,664 KB
testcase_28 AC 61 ms
80,936 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 66 ms
84,632 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 66 ms
84,400 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 64 ms
84,604 KB
testcase_41 AC 63 ms
80,252 KB
testcase_42 WA -
testcase_43 AC 60 ms
80,252 KB
testcase_44 AC 62 ms
80,248 KB
testcase_45 WA -
testcase_46 AC 62 ms
80,248 KB
testcase_47 AC 60 ms
79,260 KB
testcase_48 WA -
testcase_49 AC 61 ms
80,252 KB
testcase_50 AC 69 ms
87,724 KB
testcase_51 WA -
testcase_52 AC 68 ms
87,724 KB
testcase_53 AC 63 ms
79,308 KB
testcase_54 WA -
testcase_55 AC 62 ms
79,308 KB
testcase_56 AC 71 ms
87,728 KB
testcase_57 WA -
testcase_58 AC 68 ms
88,716 KB
testcase_59 AC 46 ms
63,444 KB
testcase_60 AC 61 ms
79,628 KB
testcase_61 AC 56 ms
75,300 KB
testcase_62 WA -
testcase_63 AC 46 ms
65,884 KB
testcase_64 AC 62 ms
80,624 KB
testcase_65 AC 56 ms
75,300 KB
testcase_66 WA -
testcase_67 AC 45 ms
63,424 KB
testcase_68 AC 53 ms
70,704 KB
testcase_69 AC 57 ms
75,300 KB
testcase_70 WA -
testcase_71 AC 48 ms
65,884 KB
testcase_72 AC 52 ms
70,704 KB
testcase_73 AC 57 ms
76,064 KB
testcase_74 AC 52 ms
70,768 KB
testcase_75 WA -
testcase_76 WA -
testcase_77 AC 58 ms
74,892 KB
testcase_78 AC 51 ms
66,716 KB
testcase_79 AC 55 ms
74,012 KB
testcase_80 AC 57 ms
74,832 KB
testcase_81 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

s, t = map(int, input().split())

def f(n):
    if n % 2 == 1:
        ans = []
        k = 0
        while (2 * (k + 1) + 1) ** 2 <= n:
            ans.append(3)
            ans.append(0)
            k += 1
        now = (2 * k + 1) ** 2
        if now == n:
            return ans
        ans.append(0)
        ans.append(1)
        now += 2
        k += 1
        while now < n and now < (2 * k - 1) ** 2 + 2 * k - 1:
            ans.append(1)
            ans.append(1)
            now += 2
        if now == n:
            return ans
        ans.append(1)
        ans.append(2)
        now += 2
        while now < n and now < (2 * k - 1) ** 2 + 4 * k - 1:
            ans.append(2)
            ans.append(2)
            now += 2
        if now == n:
            return ans
        ans.append(2)
        ans.append(3)
        now += 2
        while now < n and now < (2 * k - 1) ** 2 + 6 * k - 1:
            ans.append(3)
            ans.append(3)
            now += 2
        if now == n:
            return ans
        ans.append(3)
        ans.append(0)
        now += 2
        while now < n:
            ans.append(0)
            ans.append(0)
            now += 2
        return ans
    else:
        ans = [3]
        k = 1
        while (2 * k - 1) ** 2 + 1 < n:
            ans.append(0)
            ans.append(3)
            k += 1
        now = (2 * k - 1) ** 2 + 1
        if now == n:
            return ans
        k -= 1
        while now > n and now > (2 * k - 1) ** 2 + 6 * k + 1:
            ans.append(2)
            ans.append(2)
            now -= 2
        if now == n:
            return ans
        ans.append(2)
        ans.append(1)
        now -= 2
        while now > n and now > (2 * k - 1) ** 2 + 4 * k + 1:
            ans.append(1)
            ans.append(1)
            now -= 2
        if now == n:
            return ans
        ans.append(1)
        ans.append(0)
        now -= 2
        while now > n and now > (2 * k - 1) ** 2 + 2 * k + 1:
            ans.append(0)
            ans.append(0)
            now -= 2
        if now == n:
            return ans
        ans.append(0)
        ans.append(3)
        now -= 2
        while now > n:
            ans.append(3)
            ans.append(3)
            now -= 2
        return ans

ps, pt = f(s), f(t)
ones = len(ps) // 2 + len(pt) // 2 + 2
ans = [(t + 2) % 4 for t in reversed(ps)]

if s % 2 == 0:
    ans.append(3)
else:
    ans.append(0)
ans.append(2)
ans.append(0)
ones += 1
if ones % 2 == 1:
    ans.append(1)
    ans.append(3)
if t % 2 == 0:
    ans.append(1)
else:
    ans.append(2)
ans += pt
print(0)
print(len(ans))
print(''.join('RULD'[a] for a in ans))
0