結果
問題 |
No.2306 [Cherry 5th Tune C] ウソツキタマシイ
|
ユーザー |
|
提出日時 | 2023-05-19 21:42:31 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 225 ms / 2,000 ms |
コード長 | 283 bytes |
コンパイル時間 | 460 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 91,008 KB |
最終ジャッジ日時 | 2024-12-18 02:26:47 |
合計ジャッジ時間 | 7,678 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
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)