結果

問題 No.1624 三角形の反射
ユーザー 👑 tamatotamato
提出日時 2021-07-23 21:45:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 631 ms
コンパイル使用メモリ 87,568 KB
実行使用メモリ 72,148 KB
最終ジャッジ日時 2023-09-15 04:45:33
合計ジャッジ時間 3,395 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,824 KB
testcase_01 AC 72 ms
72,040 KB
testcase_02 AC 70 ms
72,044 KB
testcase_03 AC 73 ms
72,044 KB
testcase_04 AC 73 ms
71,672 KB
testcase_05 AC 73 ms
72,016 KB
testcase_06 AC 72 ms
71,952 KB
testcase_07 AC 70 ms
72,084 KB
testcase_08 AC 73 ms
71,824 KB
testcase_09 AC 71 ms
71,788 KB
testcase_10 AC 73 ms
71,712 KB
testcase_11 AC 70 ms
72,020 KB
testcase_12 AC 71 ms
71,580 KB
testcase_13 AC 72 ms
71,548 KB
testcase_14 AC 71 ms
71,864 KB
testcase_15 AC 73 ms
71,828 KB
testcase_16 AC 70 ms
71,668 KB
testcase_17 AC 72 ms
71,556 KB
testcase_18 AC 73 ms
71,824 KB
testcase_19 AC 70 ms
71,884 KB
testcase_20 AC 72 ms
71,828 KB
testcase_21 AC 72 ms
71,944 KB
testcase_22 AC 71 ms
72,148 KB
testcase_23 AC 71 ms
71,964 KB
testcase_24 AC 72 ms
71,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    from math import gcd
    input = sys.stdin.readline

    a, b = input().split(".")
    a = int(a) * 1000 + int(b)

    g = gcd(a, 1000)
    upper = a // g
    lower = 1000 // g
    ans = upper - 1 + lower - 1 + (upper + lower) // 2 + abs(upper - lower) // 2
    if (upper + lower) % 2 == 0:
        S = "A"
    else:
        if lower & 1:
            S = "B"
        else:
            S = "C"
    print(S, ans)


if __name__ == '__main__':
    main()
0