結果

問題 No.2203 POWER!!!!!
ユーザー ch1channnch1channn
提出日時 2023-03-03 02:21:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 779 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,780 KB
実行使用メモリ 98,168 KB
最終ジャッジ日時 2023-10-17 21:15:50
合計ジャッジ時間 2,145 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,492 KB
testcase_01 AC 39 ms
53,492 KB
testcase_02 AC 37 ms
53,492 KB
testcase_03 AC 37 ms
53,492 KB
testcase_04 AC 38 ms
53,492 KB
testcase_05 AC 38 ms
53,492 KB
testcase_06 AC 38 ms
53,492 KB
testcase_07 AC 37 ms
53,492 KB
testcase_08 AC 54 ms
65,700 KB
testcase_09 AC 70 ms
74,360 KB
testcase_10 AC 86 ms
82,780 KB
testcase_11 AC 108 ms
94,724 KB
testcase_12 AC 53 ms
65,700 KB
testcase_13 AC 79 ms
98,168 KB
testcase_14 AC 80 ms
98,168 KB
testcase_15 AC 80 ms
98,168 KB
testcase_16 AC 78 ms
98,168 KB
testcase_17 AC 78 ms
98,168 KB
testcase_18 AC 37 ms
53,492 KB
testcase_19 AC 38 ms
53,492 KB
testcase_20 AC 37 ms
53,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
if sys.platform =='ios':
	import clipboard
	a=clipboard.get()
	a = a.split('\n')
	text = '\n'.join(a)
	with open('input_file.txt','w') as f:
		f.write(text)
	sys.stdin = open('input_file.txt')
sys.setrecursionlimit(410000000)
stdin = sys.stdin 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
nm = lambda: map(int,input().split())
na_1 = lambda: list(map(lambda x:int(x)*(-1), stdin.readline().split()))
na_2 = lambda: list(map(lambda x:int(x)-1, stdin.readline().split()))

N = ni()
A = na()
k = max(A)
m = min(A)
num = [0]*8
ans = 0
for i in range(N):
	if num[A[i]-1] > 0:
		ans += num[A[i]-1]
	else:
		tmp = 0
		for j in range(N):
			tmp += A[i]**A[j]
		ans += tmp
		num[A[i]-1] += tmp
	
print(ans)
0