問題一覧 > 通常問題

No.251 Review Problem on Large Numbers of Digits (1)

レベル : / AI推定難易度 : 625 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 140
作問者 : なお
お気に入りにしたユーザー ProblemId : 392 / 自分の提出
問題文最終更新日: 2026-06-27 05:48:08
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
yukicoder 1周年記念 復習コンテスト R1 (順位表) の他の問題:

Problem Statement

Integers $N$ and $M$ are given as input.
Output the remainder when $N$ to the power of $M$ ($N^M$) is divided by $129402307$. ($129402307$ is a prime number.)

Input

N
M

The integer $N$ is given on the $1$st line, and the integer $M$ is given on the $2$nd line.
$(0 \leq N \lt 10^{100000})$, $(0 \leq M \lt 10^{100000})$
However, the input "$N=0$ and $M=0$" is not given.

Output

Output the result of the calculation.

Sample

Sample 1
Input
2
8
Output
256

$2^8 = 256$.

Sample 2
Input
7382974343
3432476397
Output
27853659

Sample 3
Input
129402306
129402306
Output
1

The remainder when $129402306$ to the power of $129402306$ is divided by $129402307$ is $1$.

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