結果
| 問題 |
No.2357 Guess the Function
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-23 23:18:20 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 561 bytes |
| コンパイル時間 | 81 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 27,504 KB |
| 平均クエリ数 | 5.45 |
| 最終ジャッジ日時 | 2024-07-01 03:04:21 |
| 合計ジャッジ時間 | 1,605 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | AC * 5 WA * 3 RE * 2 |
ソースコード
def make_divisors(n):
lower_divisors, upper_divisors = [], []
i = 1
while i*i <= n:
if n % i == 0:
lower_divisors.append(i)
if i != n // i:
upper_divisors.append(n//i)
i += 1
return lower_divisors + upper_divisors[::-1]
print('? 1', flush=True)
i = int(input())
if i == 0:
print('! 0 1', flush=True)
A = i-1
print('? 100', flush=True)
j = int(input())
P = make_divisors(100+A-j)
for B in P:
if j < B and (1+A) % B == i and (100+A) % B == j:
print('! {} {}'.format(A, B))