<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>AT274</author_name>
  <author_url>https://blog.hatena.ne.jp/AT274/</author_url>
  <blog_title>あっとのTECH LOG</blog_title>
  <blog_url>https://at274.hatenablog.com/</blog_url>
  <categories>
    <anon>競プロ</anon>
  </categories>
  <description>問題原文 atcoder.jp 解法 愚直にやると当然間に合わない。 あらかじめ全要素の和を計算しておいて、差分更新だけするようにやれば間に合う。 差分更新は各数の個数を持っておけばできる。 実装 from collections import Counter N = int(input()) A = list(map(int, input().split())) C = Counter(A) Q = int(input()) SUM = sum(A) for q in range(Q): b, c = map(int, input().split()) SUM -= C[b] * b SUM…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fat274.hatenablog.com%2Fentry%2F2020%2F06%2F22%2F213324&quot; title=&quot;ABC171 D - Replacing - あっとのTECH LOG&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://chart.apis.google.com/chart?cht=tx&amp;chl=%20%201%20%5Cleq%20N%20%5Cleq%2010%5E%7B5%7D</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-06-22 21:33:24</published>
  <title>ABC171 D - Replacing</title>
  <type>rich</type>
  <url>https://at274.hatenablog.com/entry/2020/06/22/213324</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
