結果

問題 No.338 アンケート機能
ユーザー lloyzlloyz
提出日時 2023-02-22 20:43:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 9,092 KB
最終ジャッジ日時 2023-09-30 03:34:41
合計ジャッジ時間 3,011 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
8,816 KB
testcase_01 AC 57 ms
8,892 KB
testcase_02 AC 64 ms
9,024 KB
testcase_03 AC 57 ms
8,932 KB
testcase_04 AC 56 ms
8,940 KB
testcase_05 WA -
testcase_06 AC 57 ms
8,820 KB
testcase_07 WA -
testcase_08 AC 56 ms
8,884 KB
testcase_09 WA -
testcase_10 AC 58 ms
8,852 KB
testcase_11 AC 58 ms
8,940 KB
testcase_12 AC 57 ms
8,900 KB
testcase_13 AC 57 ms
8,896 KB
testcase_14 AC 58 ms
8,908 KB
testcase_15 AC 57 ms
9,024 KB
testcase_16 AC 56 ms
8,928 KB
testcase_17 AC 56 ms
8,884 KB
testcase_18 AC 57 ms
8,992 KB
testcase_19 AC 56 ms
8,948 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 58 ms
8,896 KB
testcase_24 AC 57 ms
8,896 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 56 ms
8,824 KB
testcase_29 AC 56 ms
8,940 KB
testcase_30 AC 58 ms
8,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal, ROUND_HALF_UP

a, b = map(int, input().split())

ans = 10000
for i in range(101):
    for j in range(101):
        if i == 0 and j == 0:
            continue
        ii = Decimal(str(i))
        jj = Decimal(str(j))
        ra = 100 * ii / (ii + jj)
        rb = 100 * jj / (ii + jj)
        ra = ra.quantize(Decimal('0'), rounding=ROUND_HALF_UP)
        rb = rb.quantize(Decimal('0'), rounding=ROUND_HALF_UP)
        if ra == a and rb == b:
            ans = min(ans, i + j)
print(ans)
0