結果
問題 | No.338 アンケート機能 |
ユーザー |
|
提出日時 | 2018-08-13 15:55:14 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 675 bytes |
コンパイル時間 | 199 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-24 08:02:52 |
合計ジャッジ時間 | 1,900 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
from sys import stdin, stdoutinput = lambda: stdin.readline()write = stdout.writedef main():A, B = map(int, input().split())rnd = lambda x: (round(x, 5) * 2 + 1) // 2a = 1 if A else 0b = 1 if B else 0while 1:if A:a_ = rnd(a / (a + b) * 100)if a_ < A:a += 1continueelif a_ > A:b += 1continueif B:b_ = rnd(b / (a + b) * 100)if b_ < B:b += 1continueelif b_ > B:a += 1continuebreakprint(a + b)main()