結果
問題 |
No.16 累乗の加算
|
ユーザー |
![]() |
提出日時 | 2015-04-17 12:52:09 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 518 bytes |
コンパイル時間 | 3,565 ms |
コンパイル使用メモリ | 74,132 KB |
実行使用メモリ | 54,652 KB |
最終ジャッジ日時 | 2024-07-04 15:23:44 |
合計ジャッジ時間 | 6,446 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 11 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner koko = new Scanner(System.in); long x= koko.nextLong(); int n= koko.nextInt(); int[] a = new int[n]; long total=0; for(int i=0; i<n; i++){ a[i]=koko.nextInt(); a[i]=a[i]%1000002; long t = (long)(Math.pow(x,a[i])%1000003); total = (total+t)%1000002; } System.out.println(total); } }