結果

問題 No.338 アンケート機能
ユーザー kichirb3kichirb3
提出日時 2018-03-25 23:48:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 746 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 10,992 KB
実行使用メモリ 8,032 KB
最終ジャッジ日時 2023-09-07 12:18:17
合計ジャッジ時間 3,375 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,868 KB
testcase_01 AC 19 ms
7,852 KB
testcase_02 AC 19 ms
7,808 KB
testcase_03 AC 17 ms
7,912 KB
testcase_04 AC 18 ms
7,832 KB
testcase_05 WA -
testcase_06 AC 18 ms
7,860 KB
testcase_07 WA -
testcase_08 AC 19 ms
7,848 KB
testcase_09 WA -
testcase_10 AC 19 ms
7,848 KB
testcase_11 AC 18 ms
7,916 KB
testcase_12 AC 18 ms
7,812 KB
testcase_13 AC 19 ms
7,820 KB
testcase_14 AC 20 ms
7,876 KB
testcase_15 AC 19 ms
7,776 KB
testcase_16 AC 18 ms
7,848 KB
testcase_17 AC 19 ms
7,824 KB
testcase_18 AC 19 ms
7,776 KB
testcase_19 AC 20 ms
7,968 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 19 ms
7,952 KB
testcase_24 AC 19 ms
7,844 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 19 ms
7,924 KB
testcase_29 AC 21 ms
7,920 KB
testcase_30 AC 19 ms
7,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.338 アンケート機能
https://yukicoder.me/problems/no/338

"""
import sys
from sys import stdin
input = stdin.readline


def solve(A, B):
    ans = [A, B]
    for a in range(int(A+B+1)):
        for b in range(int(A+B+1)):
            try:
                int_a = int((100.0 * a) / (a + b) + 0.5)
                int_b = int((100.0 * b) / (a + b) + 0.5)
                if int_a == A and int_b == B:
                    if a + b < ans[0] + ans[1]:
                        ans = [a, b]
            except ZeroDivisionError:
                pass
    return ans


def main(args):
    A, B = map(float, input().split())
    ans = solve(A, B)
    print(sum(ans))


if __name__ == '__main__':
    main(sys.argv[1:])
0