結果

問題 No.251 大きな桁の復習問題(1)
ユーザー Tawara
提出日時 2015-08-01 13:59:43
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 183 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 6,948 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-18 00:27:50
合計ジャッジ時間 40,257 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import log
N = int(raw_input())
M = int(raw_input())
p = 129402307
N %= p
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