結果
| 問題 |
No.338 アンケート機能
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-16 17:34:11 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 83 ms / 2,000 ms |
| コード長 | 678 bytes |
| コンパイル時間 | 328 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-12-30 00:19:55 |
| 合計ジャッジ時間 | 3,704 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
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 = float('inf')
for a in range(1, 200 + 1):
for b in range(1, 200 + 1):
if calc_per(a, b) == (A, B):
ans = min(ans, a + b)
assert ans != float('inf')
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()