結果

問題 No.2306 [Cherry 5th Tune C] ウソツキタマシイ
ユーザー first_vilfirst_vil
提出日時 2023-05-20 08:53:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 384 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 90,708 KB
最終ジャッジ日時 2023-08-23 07:08:52
合計ジャッジ時間 11,791 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,468 KB
testcase_01 AC 78 ms
71,352 KB
testcase_02 AC 95 ms
75,496 KB
testcase_03 AC 84 ms
71,472 KB
testcase_04 AC 102 ms
76,500 KB
testcase_05 AC 104 ms
76,176 KB
testcase_06 AC 105 ms
76,000 KB
testcase_07 AC 296 ms
87,048 KB
testcase_08 AC 152 ms
82,332 KB
testcase_09 AC 221 ms
87,008 KB
testcase_10 AC 216 ms
78,712 KB
testcase_11 AC 228 ms
84,048 KB
testcase_12 AC 273 ms
90,180 KB
testcase_13 AC 211 ms
88,616 KB
testcase_14 AC 202 ms
84,656 KB
testcase_15 AC 329 ms
83,864 KB
testcase_16 AC 330 ms
79,496 KB
testcase_17 AC 371 ms
90,416 KB
testcase_18 AC 367 ms
90,592 KB
testcase_19 AC 370 ms
90,680 KB
testcase_20 AC 370 ms
90,348 KB
testcase_21 AC 369 ms
90,396 KB
testcase_22 AC 367 ms
90,484 KB
testcase_23 AC 384 ms
90,708 KB
testcase_24 AC 369 ms
90,400 KB
testcase_25 AC 374 ms
90,392 KB
testcase_26 AC 365 ms
90,368 KB
testcase_27 AC 358 ms
89,692 KB
testcase_28 AC 368 ms
89,520 KB
testcase_29 AC 342 ms
78,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mi=lambda: map(int,input().split())
li=lambda: list(mi())
ii=lambda: int(input())

n,m=mi()
a=li()
sp=sum(x**2 for x in a)
for _ in range(ii()):
	c,k,d=mi()
	c-=1
	d-=1
	sp-=a[c]**2+a[d]**2
	a[c]-=k
	a[d]+=k
	sp+=a[c]**2+a[d]**2
	print(sp)
0