結果

問題 No.338 アンケート機能
コンテスト
ユーザー GrayCoder
提出日時 2018-08-13 08:53:36
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 600 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 328 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 23,076 KB
最終ジャッジ日時 2026-04-11 14:28:54
合計ジャッジ時間 4,585 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 1 TLE * 1 -- * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from sys import stdin, stdout

input = lambda: stdin.readline().rstrip()
write = stdout.write

def main():
    A, B = map(int, input().split())

    rnd = lambda x: (x * 2 + 1) // 2
    a = 1 if A else 0
    b = 1 if B else 0
    while 1:
        flag1, flag2 = 0, 0
        n = a + b
        if A > 0:
            if rnd(a / n * 100) < A:
                a += 1
            else:
                flag1 = 1
        if B > 0:
            if rnd(b / n * 100) < B:
                b += 1
            else:
                flag2 = 1
        if flag1 and flag2:
            break
    print(a + b)

main()
0