結果

問題 No.338 アンケート機能
ユーザー lloyzlloyz
提出日時 2023-02-22 20:44:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 955 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 9,052 KB
最終ジャッジ日時 2023-09-30 03:36:19
合計ジャッジ時間 30,409 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 913 ms
9,052 KB
testcase_01 AC 886 ms
8,836 KB
testcase_02 AC 895 ms
8,904 KB
testcase_03 AC 886 ms
8,840 KB
testcase_04 AC 890 ms
8,872 KB
testcase_05 AC 861 ms
8,892 KB
testcase_06 AC 879 ms
9,016 KB
testcase_07 AC 887 ms
8,972 KB
testcase_08 AC 858 ms
8,860 KB
testcase_09 AC 930 ms
8,836 KB
testcase_10 AC 892 ms
8,900 KB
testcase_11 AC 877 ms
8,884 KB
testcase_12 AC 841 ms
8,972 KB
testcase_13 AC 906 ms
8,892 KB
testcase_14 AC 853 ms
8,836 KB
testcase_15 AC 867 ms
8,956 KB
testcase_16 AC 884 ms
8,872 KB
testcase_17 AC 891 ms
8,832 KB
testcase_18 AC 955 ms
8,908 KB
testcase_19 AC 887 ms
8,896 KB
testcase_20 AC 862 ms
8,956 KB
testcase_21 AC 883 ms
8,964 KB
testcase_22 AC 915 ms
8,952 KB
testcase_23 AC 887 ms
8,884 KB
testcase_24 AC 891 ms
9,012 KB
testcase_25 AC 902 ms
8,976 KB
testcase_26 AC 923 ms
8,892 KB
testcase_27 AC 918 ms
8,868 KB
testcase_28 AC 891 ms
8,948 KB
testcase_29 AC 899 ms
9,000 KB
testcase_30 AC 884 ms
8,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal, ROUND_HALF_UP

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

ans = 10000
for i in range(501):
    for j in range(501):
        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