結果
問題 | No.2357 Guess the Function |
ユーザー |
|
提出日時 | 2023-06-23 21:56:18 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 646 bytes |
コンパイル時間 | 151 ms |
コンパイル使用メモリ | 82,388 KB |
実行使用メモリ | 76,484 KB |
平均クエリ数 | 3.00 |
最終ジャッジ日時 | 2024-07-01 01:32:49 |
合計ジャッジ時間 | 1,776 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 8 |
ソースコード
def find_AB(x, y, a, b): # A を 0 から B-1 の範囲で探索します for A in range(0,101,1): # 式を計算し、a と一致するか確認します # B を求めるために、(y + A) % B も一致するか確認します for B in range(A+1, 101,1): if (x + A) % B == a: if (y + A) % B == b: return A, B x=2 output="? "+str(x) print(output,flush=True) a=int(input()) y=21 output="? "+str(y) print(output,flush=True) b=int(input()) result = find_AB(x, y, a, b) if result: A, B = result ans="! "+str(A)+" "+str(B) print(ans)