結果

問題 No.251 大きな桁の復習問題(1)
ユーザー Tawara
提出日時 2015-08-01 14:02:29
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 214 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 76,708 KB
実行使用メモリ 79,008 KB
最終ジャッジ日時 2024-07-18 00:28:47
合計ジャッジ時間 24,494 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import log
N = int(raw_input())
M = int(raw_input())
p = 129402307
N %= p
if M == 0:
	ans = N
else:
	ans = 1
	for i in xrange(int(log(M,2))+1):
		if (M>>i)&1:
			ans = ans * N % p
		N = N**2 % p
print ans
0