結果
問題 | No.1315 渦巻洞穴 |
ユーザー | Kude |
提出日時 | 2020-12-12 21:55:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,641 bytes |
コンパイル時間 | 249 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 98,560 KB |
最終ジャッジ日時 | 2024-09-19 22:28:20 |
合計ジャッジ時間 | 8,207 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 42 ms
52,352 KB |
testcase_01 | WA | - |
testcase_02 | AC | 42 ms
52,992 KB |
testcase_03 | AC | 40 ms
52,480 KB |
testcase_04 | AC | 38 ms
52,480 KB |
testcase_05 | AC | 40 ms
52,744 KB |
testcase_06 | WA | - |
testcase_07 | AC | 42 ms
52,224 KB |
testcase_08 | AC | 38 ms
52,352 KB |
testcase_09 | AC | 38 ms
52,608 KB |
testcase_10 | WA | - |
testcase_11 | AC | 38 ms
52,096 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 65 ms
79,744 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 61 ms
77,184 KB |
testcase_19 | AC | 64 ms
82,048 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 53 ms
71,808 KB |
testcase_23 | AC | 63 ms
83,456 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 64 ms
84,224 KB |
testcase_27 | AC | 66 ms
85,248 KB |
testcase_28 | AC | 61 ms
80,640 KB |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | AC | 64 ms
84,352 KB |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 65 ms
83,456 KB |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | AC | 65 ms
82,816 KB |
testcase_41 | AC | 61 ms
79,616 KB |
testcase_42 | WA | - |
testcase_43 | AC | 60 ms
79,488 KB |
testcase_44 | AC | 63 ms
80,640 KB |
testcase_45 | WA | - |
testcase_46 | AC | 62 ms
80,276 KB |
testcase_47 | AC | 60 ms
78,592 KB |
testcase_48 | WA | - |
testcase_49 | AC | 60 ms
79,872 KB |
testcase_50 | AC | 67 ms
87,808 KB |
testcase_51 | WA | - |
testcase_52 | AC | 68 ms
87,552 KB |
testcase_53 | AC | 60 ms
79,232 KB |
testcase_54 | WA | - |
testcase_55 | AC | 61 ms
79,744 KB |
testcase_56 | AC | 67 ms
87,808 KB |
testcase_57 | WA | - |
testcase_58 | AC | 81 ms
88,960 KB |
testcase_59 | AC | 45 ms
63,616 KB |
testcase_60 | AC | 60 ms
77,952 KB |
testcase_61 | AC | 55 ms
73,856 KB |
testcase_62 | WA | - |
testcase_63 | AC | 47 ms
64,128 KB |
testcase_64 | AC | 62 ms
79,488 KB |
testcase_65 | AC | 56 ms
73,472 KB |
testcase_66 | WA | - |
testcase_67 | AC | 49 ms
63,232 KB |
testcase_68 | AC | 55 ms
68,992 KB |
testcase_69 | AC | 59 ms
73,600 KB |
testcase_70 | WA | - |
testcase_71 | AC | 47 ms
64,000 KB |
testcase_72 | AC | 53 ms
69,632 KB |
testcase_73 | AC | 58 ms
74,752 KB |
testcase_74 | AC | 51 ms
69,504 KB |
testcase_75 | WA | - |
testcase_76 | WA | - |
testcase_77 | AC | 61 ms
74,752 KB |
testcase_78 | AC | 52 ms
65,920 KB |
testcase_79 | AC | 58 ms
73,472 KB |
testcase_80 | AC | 61 ms
74,752 KB |
testcase_81 | WA | - |
ソースコード
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) 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))