結果

問題 No.2203 POWER!!!!!
ユーザー kanenist
提出日時 2023-02-08 13:08:22
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 376 bytes
コンパイル時間 2,223 ms
コンパイル使用メモリ 74,188 KB
実行使用メモリ 66,792 KB
最終ジャッジ日時 2024-07-06 01:44:34
合計ジャッジ時間 6,859 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n + 1];
		long sum = 0;
		for(int i = 1; i <= n; i++) a[i] = sc.nextInt();
		for(int i = 1; i <= n; i++){
			for(int j = 1; j <= n; j++){
				sum += Math.pow(a[i],a[j]);
			}
		}
		System.out.println(sum);
	}
}
0