結果

問題 No.1624 三角形の反射
ユーザー H3PO4H3PO4
提出日時 2021-07-23 21:45:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 9,252 KB
最終ジャッジ日時 2023-09-15 04:45:22
合計ジャッジ時間 1,692 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
9,124 KB
testcase_01 AC 20 ms
9,000 KB
testcase_02 AC 21 ms
9,024 KB
testcase_03 AC 20 ms
9,080 KB
testcase_04 AC 20 ms
9,028 KB
testcase_05 AC 20 ms
9,252 KB
testcase_06 AC 21 ms
9,196 KB
testcase_07 AC 21 ms
9,120 KB
testcase_08 AC 20 ms
9,216 KB
testcase_09 AC 20 ms
9,096 KB
testcase_10 AC 20 ms
9,028 KB
testcase_11 AC 21 ms
9,204 KB
testcase_12 AC 21 ms
9,196 KB
testcase_13 AC 21 ms
9,028 KB
testcase_14 AC 20 ms
9,124 KB
testcase_15 AC 20 ms
9,200 KB
testcase_16 AC 21 ms
9,120 KB
testcase_17 AC 21 ms
9,064 KB
testcase_18 AC 20 ms
9,156 KB
testcase_19 AC 21 ms
9,024 KB
testcase_20 AC 20 ms
9,044 KB
testcase_21 AC 21 ms
9,036 KB
testcase_22 AC 21 ms
9,164 KB
testcase_23 AC 21 ms
9,212 KB
testcase_24 AC 21 ms
9,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
from decimal import Decimal

a = Decimal(input())
a1000 = int(1000 * a)

g = gcd(1000, a1000)
x = 1000 // g
y = a1000 // g
vertex = 'ABCA'[(x % 2) + (y % 2) * 2]
edge = x + y - 2 + abs(x - y) // 2 + (x + y) // 2
print(vertex, edge)
0