結果
問題 |
No.338 アンケート機能
|
ユーザー |
|
提出日時 | 2017-02-16 17:25:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 635 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-30 00:19:45 |
合計ジャッジ時間 | 2,633 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 9 |
ソースコード
import sys def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def solve(): A, B = map(int, input().split()) if A == 0 or B == 0: print(1) return ans = A + B for a in range(1, A + 1): for b in range(1, B + 1): if calc_per(a, b) == (A, B): ans = min(ans, a + b) print(ans) def calc_per(a, b): return myround(100*a/(a+b)), myround(100*b/(a+b)) def myround(x): return int((2*x + 1)//2) if __name__ == '__main__': solve()