結果

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

ソースコード

diff #

from math import gcd
a, b = map(int, input().split('.'))
t = a * 1000 + b
g = gcd(t, 1000)
y = t // gcd(t, 1000)
x = 1000 // gcd(t, 1000)
c = x + y - 2 + (x + y) // 2 + abs(x - y) // 2
if (x + y) % 2 == 0:
    print('A', c)
elif x % 2 == 0:
    print('C', c)
else:
    print('B', c)
0