結果
問題 |
No.338 アンケート機能
|
ユーザー |
![]() |
提出日時 | 2018-04-10 21:16:35 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 615 ms / 2,000 ms |
コード長 | 756 bytes |
コンパイル時間 | 131 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-26 20:58:00 |
合計ジャッジ時間 | 21,301 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
# -*- 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 = [float('inf'), float('inf')] for a in range(1001): for b in range(1001): 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:])