結果

問題 No.2993 冪乗乗 mod 冪乗
ユーザー 👑 p-adicp-adic
提出日時 2023-11-09 13:36:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 212 bytes
コンパイル時間 717 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 82,556 KB
最終ジャッジ日時 2024-12-17 23:40:15
合計ジャッジ時間 81,906 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,372 KB
testcase_01 AC 36 ms
52,340 KB
testcase_02 AC 35 ms
53,020 KB
testcase_03 AC 37 ms
52,328 KB
testcase_04 AC 38 ms
53,492 KB
testcase_05 AC 42 ms
54,860 KB
testcase_06 AC 136 ms
77,576 KB
testcase_07 AC 55 ms
68,176 KB
testcase_08 AC 49 ms
60,868 KB
testcase_09 AC 52 ms
66,284 KB
testcase_10 AC 411 ms
76,848 KB
testcase_11 AC 499 ms
78,096 KB
testcase_12 AC 333 ms
76,784 KB
testcase_13 AC 444 ms
77,016 KB
testcase_14 AC 1,796 ms
79,692 KB
testcase_15 AC 520 ms
78,388 KB
testcase_16 AC 1,816 ms
77,980 KB
testcase_17 AC 1,570 ms
77,704 KB
testcase_18 AC 2,287 ms
78,240 KB
testcase_19 AC 1,869 ms
77,784 KB
testcase_20 AC 1,871 ms
77,584 KB
testcase_21 AC 2,086 ms
78,500 KB
testcase_22 AC 1,888 ms
77,992 KB
testcase_23 AC 8,936 ms
80,908 KB
testcase_24 AC 8,995 ms
80,736 KB
testcase_25 AC 9,702 ms
80,452 KB
testcase_26 TLE -
testcase_27 TLE -
testcase_28 AC 8,293 ms
81,048 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#誤解法(n=max(N,1)+8に限定する愚直冪乗)チェック
I=input
for t in[0]*int(I()):
	B,N,M=map(int,I().split())
	D=B**N
	E=B**(max(N,1)+8)
	P=pow(M,E,E*D)-1
	a=P//E
	print(-1if(P-a*E)%(E*D)else a%D)
0