問題一覧 > 通常問題

No.3115 One Power One Kill

レベル : / AI推定難易度 : 1625 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / リアクティブ問題 (詳しくはこちら)
タグ : (AC するまで非表示) / 解いたユーザー数 87
作問者 : Nzt3 / テスター : ponjuice kenken714 Naru820
お気に入りにしたユーザー ProblemId : 12107 / 自分の提出
問題文最終更新日: 2025-04-18 00:28:49
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
CPCTF 2025 : PPC (順位表) の他の問題:

Problem Statement

This is a reactive problem.

The judge holds a hidden integer $X$ between $100$ and $10^5$, inclusive. By performing the following operation $1$ time, determine $X'$ after the operation.

  1. You declare integers $A,B$ between $100$ and $10^5$, inclusive, and tell them to the judge.
  2. Let $Y=A^B \mathrm{mod} (10^{9}+7)$.
  3. The judge tells you $K=\gcd(X,Y)$.
  4. $X'$ is set to $X^A \mathrm{mod} B$.

The judge is adaptive and may change the value of $X$ along the way, as long as it does not contradict its responses so far.

Constraints

  • $100 \le X \le 10^5$

Input and Output

First, output $A,B$.

$A$ $B$

$K$ computed by the judge is given.

$K$

Output your guess of $X'$.

$X'$

An integer $\mathrm{ret}$ representing the result is given.

$\mathrm{ret}$

$\mathrm{ret}=1$ means that your guess is correct.
$\mathrm{ret}=0$ means that your guess is incorrect.

Notes

  • The judge is adaptive. See the sample for a concrete example.
  • Flush after every output.
    • For example, you can use std::cout<<std::endl in C++ or print(flush=True) in Python3.
  • If your output format is incorrect, the judge result may be undefined.

Sample

InputOutputExplanation
The judge sets $X=100$. You are not told this value.
123 456You chose $A=123,B=456$.
The judge computes $Y=123^{456} \pmod{10^9+7} = 565291922$.
2The judge computes $K=\gcd(X,Y)=2$.
The judge computes $X'=100^{123} \pmod{456} = 64$. You are not told this value.
64You guessed $X'=64$.
$X=106$ would also not contradict $A,B,K$.
The judge changes to $X=106$. It is changed to $X'=106^{123}\pmod{456}=400$.
0Your guess of $X'$ is judged to be incorrect.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。