結果

問題 No.1000 Point Add and Array Add
ユーザー moooakimoooaki
提出日時 2020-02-28 22:31:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 588 bytes
コンパイル時間 2,425 ms
コンパイル使用メモリ 162,304 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-04-21 19:37:27
合計ジャッジ時間 6,878 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
10,624 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 5 ms
5,376 KB
testcase_13 AC 3 ms
5,376 KB
testcase_14 AC 6 ms
5,376 KB
testcase_15 AC 5 ms
5,376 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define INF (long long)(10e9+7)
#define REP(i,n) for(ll i = 0; i < n; i++)
#define REP1(i,n) for(ll i = 1; i <= n; i++)
ll A[200200], B[200200];

int main(void)
{
    ll N, Q;
    char c;
    ll x, y;
    cin >> N >> Q;
    REP(i, N) cin >> A[i];
    REP(i, Q) {
        cin >> c >> x >> y;
        if(c=='A') {
            A[x-1] += y;
        } else {
            for(ll i = x; i <= y; i++) {
                B[i - 1] += A[i - 1];
            }
        }
    }
    REP(i, N) cout << B[i] << " ";
    cout << endl;
}
0