結果
| 問題 |
No.1464 Number Conversion
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2023-11-25 07:56:48 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 247 bytes |
| コンパイル時間 | 150 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-26 10:12:10 |
| 合計ジャッジ時間 | 1,725 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
ソースコード
import sys
readline=sys.stdin.readline
from math import gcd as GCD
X=readline().rstrip()
if "." in X:
i=X.index(".")
a,b=int(X[:i]+X[i+1:]),10**(len(X)-(i+1))
g=GCD(a,b)
a//=g
b//=g
else:
a,b=int(X),1
print(a,"/",b,sep="")
vwxyz