結果
問題 | No.1315 渦巻洞穴 |
ユーザー | Kude |
提出日時 | 2020-12-12 22:29:00 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 2,506 bytes |
コンパイル時間 | 300 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 95,360 KB |
最終ジャッジ日時 | 2024-09-19 22:31:24 |
合計ジャッジ時間 | 7,505 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 36 ms
52,480 KB |
testcase_01 | AC | 36 ms
52,608 KB |
testcase_02 | AC | 34 ms
52,608 KB |
testcase_03 | AC | 33 ms
52,608 KB |
testcase_04 | AC | 34 ms
52,480 KB |
testcase_05 | AC | 32 ms
52,480 KB |
testcase_06 | AC | 35 ms
52,480 KB |
testcase_07 | AC | 37 ms
52,352 KB |
testcase_08 | AC | 35 ms
52,352 KB |
testcase_09 | AC | 35 ms
52,992 KB |
testcase_10 | AC | 38 ms
52,480 KB |
testcase_11 | AC | 35 ms
52,608 KB |
testcase_12 | AC | 35 ms
52,880 KB |
testcase_13 | AC | 53 ms
74,112 KB |
testcase_14 | AC | 54 ms
77,056 KB |
testcase_15 | AC | 60 ms
79,104 KB |
testcase_16 | AC | 55 ms
76,800 KB |
testcase_17 | AC | 57 ms
79,488 KB |
testcase_18 | AC | 55 ms
76,928 KB |
testcase_19 | AC | 59 ms
82,560 KB |
testcase_20 | AC | 58 ms
81,792 KB |
testcase_21 | AC | 55 ms
72,192 KB |
testcase_22 | AC | 51 ms
71,680 KB |
testcase_23 | AC | 60 ms
83,840 KB |
testcase_24 | AC | 73 ms
90,116 KB |
testcase_25 | RE | - |
testcase_26 | AC | 59 ms
84,224 KB |
testcase_27 | AC | 62 ms
85,504 KB |
testcase_28 | AC | 57 ms
81,024 KB |
testcase_29 | AC | 56 ms
78,976 KB |
testcase_30 | RE | - |
testcase_31 | AC | 60 ms
84,736 KB |
testcase_32 | RE | - |
testcase_33 | AC | 60 ms
84,224 KB |
testcase_34 | AC | 62 ms
83,328 KB |
testcase_35 | AC | 62 ms
81,792 KB |
testcase_36 | AC | 63 ms
81,920 KB |
testcase_37 | AC | 73 ms
91,136 KB |
testcase_38 | AC | 56 ms
76,928 KB |
testcase_39 | RE | - |
testcase_40 | AC | 56 ms
83,328 KB |
testcase_41 | AC | 56 ms
80,000 KB |
testcase_42 | AC | 62 ms
80,000 KB |
testcase_43 | AC | 60 ms
79,744 KB |
testcase_44 | AC | 62 ms
80,384 KB |
testcase_45 | AC | 57 ms
79,616 KB |
testcase_46 | AC | 57 ms
80,640 KB |
testcase_47 | AC | 55 ms
78,976 KB |
testcase_48 | AC | 56 ms
80,124 KB |
testcase_49 | AC | 57 ms
79,744 KB |
testcase_50 | AC | 66 ms
87,552 KB |
testcase_51 | RE | - |
testcase_52 | AC | 69 ms
87,680 KB |
testcase_53 | AC | 60 ms
79,616 KB |
testcase_54 | AC | 67 ms
88,600 KB |
testcase_55 | AC | 58 ms
79,360 KB |
testcase_56 | AC | 65 ms
87,748 KB |
testcase_57 | RE | - |
testcase_58 | AC | 64 ms
89,096 KB |
testcase_59 | AC | 43 ms
63,488 KB |
testcase_60 | AC | 56 ms
78,080 KB |
testcase_61 | AC | 51 ms
73,728 KB |
testcase_62 | AC | 58 ms
79,872 KB |
testcase_63 | AC | 48 ms
63,744 KB |
testcase_64 | AC | 73 ms
79,616 KB |
testcase_65 | AC | 55 ms
73,856 KB |
testcase_66 | AC | 58 ms
77,952 KB |
testcase_67 | AC | 43 ms
63,488 KB |
testcase_68 | AC | 50 ms
69,504 KB |
testcase_69 | AC | 54 ms
73,600 KB |
testcase_70 | AC | 57 ms
78,464 KB |
testcase_71 | AC | 43 ms
64,000 KB |
testcase_72 | AC | 48 ms
69,248 KB |
testcase_73 | AC | 53 ms
75,008 KB |
testcase_74 | AC | 48 ms
69,120 KB |
testcase_75 | AC | 34 ms
52,736 KB |
testcase_76 | AC | 36 ms
52,820 KB |
testcase_77 | AC | 55 ms
75,008 KB |
testcase_78 | AC | 45 ms
65,792 KB |
testcase_79 | AC | 50 ms
72,960 KB |
testcase_80 | AC | 60 ms
74,864 KB |
testcase_81 | AC | 68 ms
86,784 KB |
ソースコード
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 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 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 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)) assert len(ans) <= 2 * 10 ** 5 print(''.join('RULD'[a] for a in ans))