結果
| 問題 |
No.2357 Guess the Function
|
| コンテスト | |
| ユーザー |
👑 SPD_9X2
|
| 提出日時 | 2023-06-23 21:44:09 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 487 bytes |
| コンパイル時間 | 260 ms |
| コンパイル使用メモリ | 82,148 KB |
| 実行使用メモリ | 82,580 KB |
| 平均クエリ数 | 2.91 |
| 最終ジャッジ日時 | 2024-07-01 01:19:17 |
| 合計ジャッジ時間 | 1,940 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 RE * 1 |
ソースコード
"""
100+A % B = C
1回目も有効活用しないとだめ
(100+A) % B = C
(100+A-C-1) % B = B-1
で、Bがわかる
AはB未満なので、一意
"""
import sys
print ("?",100,flush=True)
c = int(input())
print ("?",100-c-1,flush=True)
d = int(input())
b = d + 1
for a in range(1,b):
if (100+a) % b == c:
print ("!",a,b)
sys.exit()
a = 0
for b in range(1,101):
if (a+100) % b == c and (100+a-c-1) % b == d:
print ("!",a,b)
sys.exit()
SPD_9X2