結果
問題 | No.2357 Guess the Function |
ユーザー |
|
提出日時 | 2023-06-23 21:41:58 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 694 bytes |
コンパイル時間 | 668 ms |
コンパイル使用メモリ | 86,980 KB |
実行使用メモリ | 95,084 KB |
平均クエリ数 | 2.00 |
最終ジャッジ日時 | 2023-09-13 16:41:28 |
合計ジャッジ時間 | 2,859 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
ソースコード
def find_AB(x, y, a, b): # A を 0 から B-1 の範囲で探索します for A in range(0,100): # 式を計算し、a と一致するか確認します if (x + A) % b == a: # B を求めるために、(y + A) % B も一致するか確認します for B in range(A+1, 100): if (y + A) % B == b: return A, B # 解が見つからなかった場合は None を返します return None x=2 output="? "+str(x) print(output,flush=True) a=int(input()) y=3 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)