結果

問題 No.338 アンケート機能
ユーザー FromBooskaFromBooska
提出日時 2023-09-21 21:32:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 86,684 KB
実行使用メモリ 71,632 KB
最終ジャッジ日時 2023-09-21 21:32:07
合計ジャッジ時間 4,596 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,364 KB
testcase_01 AC 79 ms
71,192 KB
testcase_02 AC 79 ms
71,116 KB
testcase_03 AC 83 ms
71,332 KB
testcase_04 AC 80 ms
71,164 KB
testcase_05 AC 89 ms
71,528 KB
testcase_06 AC 81 ms
71,364 KB
testcase_07 AC 81 ms
71,220 KB
testcase_08 AC 79 ms
71,220 KB
testcase_09 AC 80 ms
71,432 KB
testcase_10 AC 77 ms
71,420 KB
testcase_11 AC 78 ms
71,248 KB
testcase_12 AC 79 ms
71,392 KB
testcase_13 AC 85 ms
71,516 KB
testcase_14 AC 81 ms
71,112 KB
testcase_15 AC 78 ms
70,936 KB
testcase_16 AC 80 ms
71,216 KB
testcase_17 AC 77 ms
71,176 KB
testcase_18 AC 79 ms
71,632 KB
testcase_19 AC 80 ms
71,216 KB
testcase_20 AC 80 ms
71,592 KB
testcase_21 AC 80 ms
71,272 KB
testcase_22 AC 82 ms
71,224 KB
testcase_23 AC 80 ms
71,392 KB
testcase_24 AC 81 ms
71,216 KB
testcase_25 AC 81 ms
71,192 KB
testcase_26 AC 82 ms
71,168 KB
testcase_27 AC 82 ms
71,172 KB
testcase_28 AC 81 ms
71,492 KB
testcase_29 AC 78 ms
71,180 KB
testcase_30 AC 80 ms
71,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 式変形してみたけどピンと来ない
# a+b, aで全探索してみるか

from math import floor, ceil
A, B = map(int, input().split())
for ab in range(1, 10000):
    a_lower = ab*(A-0.5)/100
    a_upper = ab*(A+0.5)/100
    for a in range(floor(a_lower), ceil(a_upper)+1):
        b = ab-a
        if b >= 0:
            if (A-0.5)*ab <= 100*a < (A+0.5)*ab:
                if (B-0.5)*ab <= 100*b < (B+0.5)*ab:
                    print(ab)
                    exit()
0