結果

問題 No.2357 Guess the Function
ユーザー 3lonco3lonco
提出日時 2023-06-23 21:40:27
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 658 bytes
コンパイル時間 1,125 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 98,884 KB
最終ジャッジ日時 2023-09-13 16:39:58
合計ジャッジ時間 5,168 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
a=int(input())
y=3
output="? "+str(y)
b=int(input())


result = find_AB(x, y, a, b)
if result:
    A, B = result
    ans="! "+str(A)+" "+str(B)
0