結果

問題 No.16 累乗の加算
ユーザー fal_rndfal_rnd
提出日時 2016-10-29 20:33:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 159 ms / 5,000 ms
コード長 440 bytes
コンパイル時間 2,193 ms
コンパイル使用メモリ 74,960 KB
実行使用メモリ 56,200 KB
最終ジャッジ日時 2023-09-08 12:02:40
合計ジャッジ時間 5,110 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,564 KB
testcase_01 AC 127 ms
55,688 KB
testcase_02 AC 157 ms
56,200 KB
testcase_03 AC 143 ms
56,028 KB
testcase_04 AC 146 ms
55,804 KB
testcase_05 AC 148 ms
55,984 KB
testcase_06 AC 157 ms
55,788 KB
testcase_07 AC 158 ms
55,844 KB
testcase_08 AC 158 ms
55,756 KB
testcase_09 AC 159 ms
55,500 KB
testcase_10 AC 153 ms
55,756 KB
testcase_11 AC 128 ms
55,388 KB
testcase_12 AC 155 ms
55,948 KB
testcase_13 AC 135 ms
55,756 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