結果

問題 No.251 大きな桁の復習問題(1)
ユーザー TawaraTawara
提出日時 2015-08-01 14:02:29
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 214 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 77,124 KB
実行使用メモリ 80,012 KB
最終ジャッジ日時 2023-09-25 00:12:24
合計ジャッジ時間 39,009 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 84 ms
76,268 KB
testcase_03 AC 76 ms
76,448 KB
testcase_04 AC 76 ms
76,612 KB
testcase_05 AC 75 ms
76,400 KB
testcase_06 AC 74 ms
76,556 KB
testcase_07 AC 77 ms
75,952 KB
testcase_08 AC 76 ms
76,316 KB
testcase_09 AC 3,231 ms
79,424 KB
testcase_10 AC 3,231 ms
80,012 KB
testcase_11 AC 3,245 ms
79,788 KB
testcase_12 AC 3,227 ms
79,532 KB
testcase_13 AC 3,279 ms
79,544 KB
testcase_14 AC 3,280 ms
79,992 KB
testcase_15 AC 3,256 ms
79,408 KB
testcase_16 AC 3,263 ms
79,720 KB
testcase_17 AC 3,265 ms
79,668 KB
testcase_18 AC 3,277 ms
79,800 KB
testcase_19 AC 3,242 ms
79,396 KB
testcase_20 AC 76 ms
76,372 KB
testcase_21 AC 75 ms
76,128 KB
testcase_22 AC 76 ms
76,400 KB
testcase_23 AC 76 ms
76,612 KB
権限があれば一括ダウンロードができます

ソースコード

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