結果

問題 No.2357 Guess the Function
ユーザー shogo314shogo314
提出日時 2023-06-23 23:14:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 1,000 ms
コード長 478 bytes
コンパイル時間 1,490 ms
コンパイル使用メモリ 86,560 KB
実行使用メモリ 91,988 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-13 18:22:20
合計ジャッジ時間 2,549 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
91,560 KB
testcase_01 AC 108 ms
91,940 KB
testcase_02 AC 105 ms
91,460 KB
testcase_03 AC 105 ms
91,436 KB
testcase_04 AC 101 ms
91,852 KB
testcase_05 AC 100 ms
91,268 KB
testcase_06 AC 98 ms
91,920 KB
testcase_07 AC 103 ms
91,460 KB
testcase_08 AC 101 ms
91,752 KB
testcase_09 AC 101 ms
91,988 KB
testcase_10 AC 98 ms
91,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MAX = 100
s1=50
print('?',s1,flush=True)
t1=int(input())
ab=[]
for a in range(MAX):
    for b in range(max(t1,a)+1,MAX+1):
        if (s1+a)%b==t1:
            ab.append((a,b))
for s2 in range(1,MAX+1):
    for t2 in range(MAX):
        cnt=0
        for a,b in ab:
            if (s2+a)%b==t2:
                cnt+=1
        if cnt>=2:
            break
    else:
        break
print('?',s2,flush=True)
t2=int(input())
for a,b in ab:
    if (s2+a)%b==t2:
        print('!',a,b)
0