結果

問題 No.1624 三角形の反射
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-07-23 22:22:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,512 KB
実行使用メモリ 71,752 KB
最終ジャッジ日時 2023-09-15 04:48:03
合計ジャッジ時間 3,222 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,340 KB
testcase_01 AC 74 ms
71,588 KB
testcase_02 AC 73 ms
71,480 KB
testcase_03 AC 72 ms
71,284 KB
testcase_04 AC 76 ms
71,664 KB
testcase_05 AC 73 ms
71,332 KB
testcase_06 AC 72 ms
71,544 KB
testcase_07 AC 74 ms
71,656 KB
testcase_08 AC 74 ms
71,272 KB
testcase_09 AC 76 ms
71,596 KB
testcase_10 AC 73 ms
71,472 KB
testcase_11 AC 74 ms
71,588 KB
testcase_12 AC 74 ms
71,336 KB
testcase_13 AC 77 ms
71,752 KB
testcase_14 AC 75 ms
71,456 KB
testcase_15 AC 74 ms
71,744 KB
testcase_16 AC 76 ms
71,476 KB
testcase_17 AC 76 ms
71,468 KB
testcase_18 AC 80 ms
71,672 KB
testcase_19 AC 76 ms
71,332 KB
testcase_20 AC 74 ms
71,392 KB
testcase_21 AC 75 ms
71,340 KB
testcase_22 AC 76 ms
71,280 KB
testcase_23 AC 77 ms
71,688 KB
testcase_24 AC 78 ms
71,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

折り返して考える
最初に付く整数頂点がどれかを考えればよい

偶奇がひとしい = A
xが奇数 = B
xが偶数 = C

反射回数は


"""

import math
import bisect

a = int(float(input()) * 1000 + 0.1)

yt = (a * 1000 // math.gcd(a,1000)) // 1000
xt = (yt*1000) // a

if xt % 2 == yt % 2:
    c = "A"
elif xt % 2 == 1:
    c = "B"
else:
    c = "C"

#print (c)

ans = (xt-1) + (yt-1) + (max(xt,yt))

if c != "A":
    ans -= 1

print (c,ans)
0