結果

問題 No.2828 Remainder Game
ユーザー naut3naut3
提出日時 2024-08-02 22:06:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 678 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 28,368 KB
平均クエリ数 61.40
最終ジャッジ日時 2024-08-02 22:06:13
合計ジャッジ時間 4,154 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 WA -
testcase_04 WA -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 92 ms
27,864 KB
testcase_09 RE -
testcase_10 AC 93 ms
27,864 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 89 ms
27,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import random

N = int(input())

P = [2, 3, 5, 7, 11, 13]
R = [0, 0, 0, 0, 0, 0]

for (j, p) in enumerate(P):
    cnt = 0

    rng = [i for i in range(1, p)]
    random.shuffle(rng)

    for i in rng:
        print(p, 1, flush=True)
        print(i, flush=True)

        C = int(input())
        R[j] += C * i
        R[j] %= p

        cnt += C

        if cnt == 5:
            break

a = 0

for r in range(2 * 3 * 5 * 7 * 11 * 13):
    isok = True

    for i in range(6):
        p = P[i]
        q = R[i]

        if r % p != q:
            isok = False

    if isok:
        a = r
        break

# a, a + 2 * 3 * 5 * 7 * 13 のどっちか
print(0, 1, "\n", a, flush=True)
0