結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー fiordfiord
提出日時 2017-02-27 07:14:38
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 119 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 6,636 KB
実行使用メモリ 6,172 KB
最終ジャッジ日時 2023-09-02 12:18:19
合計ジャッジ時間 1,161 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,996 KB
testcase_01 AC 12 ms
6,072 KB
testcase_02 AC 12 ms
6,168 KB
testcase_03 AC 12 ms
5,984 KB
testcase_04 AC 12 ms
6,164 KB
testcase_05 AC 11 ms
6,076 KB
testcase_06 AC 12 ms
6,048 KB
testcase_07 AC 12 ms
5,972 KB
testcase_08 AC 12 ms
6,044 KB
testcase_09 AC 12 ms
6,116 KB
testcase_10 AC 12 ms
6,072 KB
testcase_11 AC 12 ms
6,036 KB
testcase_12 AC 12 ms
6,044 KB
testcase_13 AC 12 ms
6,172 KB
testcase_14 AC 11 ms
6,036 KB
testcase_15 AC 12 ms
5,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

m=input()
a=(2017*2017)%m
p=2017
ret=1
while p>0:
	if p&1:
		ret=(ret*a)%m
	a=(a*a)%m
	p/=2
ret=(ret+2017)%m
print ret
0