結果

問題 No.16 累乗の加算
ユーザー fal_rndfal_rnd
提出日時 2016-10-29 20:31:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 161 ms / 5,000 ms
コード長 458 bytes
コンパイル時間 2,182 ms
コンパイル使用メモリ 73,232 KB
実行使用メモリ 55,860 KB
最終ジャッジ日時 2023-09-08 12:02:46
合計ジャッジ時間 5,038 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,564 KB
testcase_01 AC 127 ms
55,456 KB
testcase_02 AC 161 ms
55,584 KB
testcase_03 AC 150 ms
55,308 KB
testcase_04 AC 144 ms
55,568 KB
testcase_05 AC 145 ms
55,332 KB
testcase_06 AC 155 ms
55,660 KB
testcase_07 AC 152 ms
55,636 KB
testcase_08 AC 159 ms
55,808 KB
testcase_09 AC 161 ms
53,956 KB
testcase_10 AC 157 ms
55,660 KB
testcase_11 AC 134 ms
55,464 KB
testcase_12 AC 153 ms
55,732 KB
testcase_13 AC 135 ms
55,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import static java.math.BigInteger.*;
import java.math.*;
import java.util.*;
class A{
Scanner s=new Scanner(System.in);
int mod=1000003;
BigInteger modb=valueOf(this.mod);
public static void main(String[] args){
Scanner s=new Scanner(System.in);
int mod=1000003;
BigInteger modb=valueOf(mod),in=valueOf(s.nextInt());
s.next();
long r=0;
while(s.hasNext()){
r+=Long.parseLong(in.modPow(valueOf(s.nextInt()),modb).toString());
}
System.out.println(r%mod);
}
}
0