結果

問題 No.2306 [Cherry 5th Tune C] ウソツキタマシイ
ユーザー miho-4miho-4
提出日時 2023-05-19 21:42:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 1,260 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 91,812 KB
最終ジャッジ日時 2023-08-22 23:43:19
合計ジャッジ時間 9,169 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,064 KB
testcase_01 AC 68 ms
71,112 KB
testcase_02 AC 90 ms
75,728 KB
testcase_03 AC 71 ms
71,144 KB
testcase_04 AC 85 ms
76,212 KB
testcase_05 AC 86 ms
76,432 KB
testcase_06 AC 90 ms
76,156 KB
testcase_07 AC 179 ms
88,440 KB
testcase_08 AC 118 ms
82,900 KB
testcase_09 AC 146 ms
87,880 KB
testcase_10 AC 141 ms
81,416 KB
testcase_11 AC 146 ms
84,924 KB
testcase_12 AC 169 ms
90,644 KB
testcase_13 AC 152 ms
89,404 KB
testcase_14 AC 144 ms
85,308 KB
testcase_15 AC 197 ms
88,092 KB
testcase_16 AC 195 ms
88,292 KB
testcase_17 AC 216 ms
91,588 KB
testcase_18 AC 214 ms
91,812 KB
testcase_19 AC 213 ms
91,592 KB
testcase_20 AC 213 ms
91,560 KB
testcase_21 AC 212 ms
91,352 KB
testcase_22 AC 215 ms
91,552 KB
testcase_23 AC 221 ms
91,536 KB
testcase_24 AC 217 ms
91,524 KB
testcase_25 AC 218 ms
91,652 KB
testcase_26 AC 222 ms
91,660 KB
testcase_27 AC 205 ms
91,000 KB
testcase_28 AC 211 ms
91,128 KB
testcase_29 AC 195 ms
87,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
L=list(map(int,input().split()))
q=int(input())
Q=[list(map(int,input().split())) for _ in range(q)]
tmp=0
for e in L:
  tmp+=e**2

for c,k,d in Q:
  c-=1
  d-=1
  tmp-=L[c]**2
  tmp-=L[d]**2
  L[c]-=k
  L[d]+=k
  tmp+=L[c]**2
  tmp+=L[d]**2
  print(tmp)
0