No.1232 2^x = x
問題文最終更新日: 2019-07-28 18:10:13
English (AI translation)
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.
Show the original
yukicoder contest 266
(順位表)
の他の問題:
Problem Statement
You are given primes $p_1, \dots, p_N$. For each $i$, find one positive integer $x$ not exceeding $10^{18}$ that satisfies $2^x = x \pmod {p_i}$.
Input
$N$ $p_1$ $\dots$ $p_N$
$1 \le N \le 1000$
$2 \le p_i \le 10^9$
$p_i$ is prime
Output
On line $i$, output a positive integer $x$ not exceeding $10^{18}$ that satisfies $2^x = x \pmod {p_i}$.
If no such integer exists, output $-1$ instead.
If there are multiple solutions, you may output any of them.
Sample
Sample 1
Input
3 5 3 2
Output
3 4 2
We have $2^3 = 8 = 3 \pmod 5$, $2^4 = 16 = 4 \pmod 3$, and $2^2 = 4 = 2 \pmod 2$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
t33f
37zigen