結果
| 問題 |
No.1464 Number Conversion
|
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2021-04-02 21:47:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 2,000 ms |
| コード長 | 262 bytes |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 82,196 KB |
| 実行使用メモリ | 51,968 KB |
| 最終ジャッジ日時 | 2024-12-23 18:59:56 |
| 合計ジャッジ時間 | 1,925 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
ソースコード
x = input()
n = len(x)
p = x.find('.')
if p == -1:
print(x + '/1')
exit()
c2 = c5 = n - p - 1
x = int(x.replace('.', ''))
while x % 2 == 0 and c2:
c2 -= 1
x //= 2
while x % 5 == 0 and c5:
c5 -= 1
x //= 5
print(f'{x}/{2 ** c2 * 5 ** c5}')
Kude