結果

問題 No.1624 三角形の反射
ユーザー Kude
提出日時 2021-07-23 21:49:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 81,976 KB
実行使用メモリ 54,004 KB
最終ジャッジ日時 2024-07-02 09:50:55
合計ジャッジ時間 1,865 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
t = int(float(input()) * 1000 + 0.5)
g = gcd(t, 1000)
a = 1000 // g
b = t // g
v = 'A' if (a + b) % 2 == 0 else 'B' if a % 2 else 'C'

ans = a - 1 + b - 1
p = abs(a - b)
q = abs(a + b)
ans += p // 2 + q // 2
print(v, ans)
0