結果

問題 No.2357 Guess the Function
ユーザー navel_tosnavel_tos
提出日時 2023-06-23 23:05:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 1,000 ms
コード長 434 bytes
コンパイル時間 1,001 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 92,160 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-13 18:13:35
合計ジャッジ時間 2,665 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
91,840 KB
testcase_01 AC 98 ms
92,160 KB
testcase_02 AC 98 ms
91,876 KB
testcase_03 AC 99 ms
91,972 KB
testcase_04 AC 98 ms
91,352 KB
testcase_05 AC 99 ms
92,120 KB
testcase_06 AC 98 ms
91,900 KB
testcase_07 AC 97 ms
91,932 KB
testcase_08 AC 98 ms
91,500 KB
testcase_09 AC 100 ms
91,784 KB
testcase_10 AC 97 ms
92,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

print('? '+str(50)); N=int(input())

#A+50が余りNとなる組を抽出
X=set()
for A in range(0,101):
    for B in range(A+1,101):
        if (A+50)%B==N: X.add((A,B))

#次の質問を決める
for y in range(1,101):
    Y=set()
    for A,B in X:
        Y.add((A+y)%B)
    if len(Y)!=len(X): continue
    else: break

print('? '+str(y)); M=int(input())
for A,B in X:
    if (A+y)%B==M: print('! '+str(A)+' '+str(B)); break
exit()
0