結果
問題 | No.2306 [Cherry 5th Tune C] ウソツキタマシイ |
ユーザー |
|
提出日時 | 2023-08-05 13:01:25 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 151 ms / 2,000 ms |
コード長 | 450 bytes |
コンパイル時間 | 219 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 91,904 KB |
最終ジャッジ日時 | 2024-10-15 10:07:43 |
合計ジャッジ時間 | 7,502 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
import sysdef input(): return sys.stdin.readline().rstrip()def main():N, M = map(int, input().split())*A, = map(int, input().split())z = sum(i**2 for i in A)Q = int(input())for i in range(Q):c, k, d = map(int, input().split())c -= 1d -= 1z -= A[c]**2 + A[d]**2A[c] -= kA[d] += kz += A[c]**2 + A[d]**2print(z)if __name__ == '__main__':main()