結果
| 問題 | No.1464 Number Conversion | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-09-09 13:32:28 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 381 bytes | 
| コンパイル時間 | 371 ms | 
| コンパイル使用メモリ | 81,852 KB | 
| 実行使用メモリ | 52,396 KB | 
| 最終ジャッジ日時 | 2025-09-09 13:32:31 | 
| 合計ジャッジ時間 | 3,098 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 28 WA * 1 | 
ソースコード
x = [str(i) for i in input().split(".")]
def gcd(a,b):
  #print(a,b)
  if a*b == 0:
    return 1
  if b>a:
    a,b=b,a
  if a==b:
    return max(a,1)
  elif a%b==0:
    return b
  else:
    return gcd(b,a%b)
if len(x) == 1:
  print(str(x[0])+"/1")
else:
  a = int(x[0])
  t = x[1]
  b = 10**len(t)
  c = b*a+int(t)
  d = gcd(b,c)
  b //= d
  c //= d
  print(str(c)+"/"+str(b))
  
            
            
            
        