結果

問題 No.1624 三角形の反射
ユーザー KudeKude
提出日時 2021-07-23 21:49:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 71,616 KB
最終ジャッジ日時 2023-09-15 04:46:07
合計ジャッジ時間 3,620 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,380 KB
testcase_01 AC 74 ms
71,144 KB
testcase_02 AC 73 ms
71,532 KB
testcase_03 AC 71 ms
71,292 KB
testcase_04 AC 74 ms
71,404 KB
testcase_05 AC 73 ms
71,616 KB
testcase_06 AC 72 ms
71,536 KB
testcase_07 AC 72 ms
71,184 KB
testcase_08 AC 73 ms
71,408 KB
testcase_09 AC 73 ms
71,176 KB
testcase_10 AC 73 ms
71,244 KB
testcase_11 AC 72 ms
70,932 KB
testcase_12 AC 73 ms
71,256 KB
testcase_13 AC 74 ms
71,368 KB
testcase_14 AC 73 ms
71,164 KB
testcase_15 AC 73 ms
71,360 KB
testcase_16 AC 73 ms
71,412 KB
testcase_17 AC 72 ms
70,940 KB
testcase_18 AC 73 ms
70,944 KB
testcase_19 AC 74 ms
71,444 KB
testcase_20 AC 74 ms
71,436 KB
testcase_21 AC 74 ms
71,336 KB
testcase_22 AC 73 ms
70,884 KB
testcase_23 AC 74 ms
71,492 KB
testcase_24 AC 74 ms
71,164 KB
権限があれば一括ダウンロードができます

ソースコード

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