結果
問題 | No.338 アンケート機能 |
ユーザー |
![]() |
提出日時 | 2025-03-26 15:45:17 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 862 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 82,632 KB |
実行使用メモリ | 53,828 KB |
最終ジャッジ日時 | 2025-03-26 15:45:43 |
合計ジャッジ時間 | 2,294 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
import mathA, B = map(int, input().split())n = 1while True:# Calculate A's a rangea_min_A = math.ceil(( (2*A - 1) * n ) / 200.0 )a_max_A = math.floor( ( (2*A + 1) * n ) / 200.0 - 1e-9 )# Calculate B's a rangenum_b_min = (2*(100 - B) - 1) * nb_min = math.floor(num_b_min / 200.0) + 1num_b_max = (2*(100 - B) + 1) * nb_max = math.floor(num_b_max / 200.0)# Find overlapping rangelower = max(a_min_A, b_min)upper = min(a_max_A, b_max)if lower > upper:n += 1continue# Adjust to a valid range (0 <= a <= n)if lower < 0:lower = 0if upper > n:upper = nif lower > upper:n += 1continue# Check if there's any integer in [lower, upper]if lower <= upper:print(n)breakn += 1