結果

問題 No.1000 Point Add and Array Add
ユーザー SDESTINY_kprSDESTINY_kpr
提出日時 2020-02-29 21:24:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 544 bytes
コンパイル時間 1,746 ms
コンパイル使用メモリ 166,012 KB
実行使用メモリ 13,880 KB
最終ジャッジ日時 2024-04-21 21:55:39
合計ジャッジ時間 6,168 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,752 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 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 4 ms
5,376 KB
testcase_13 AC 3 ms
5,376 KB
testcase_14 AC 5 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;
using ll = long long;
using P = pair<int,int>;
#define rep(i,n) for(int i=0;i<n;i++)

const ll mod = ll(1e9) + 7;
const int INF = 1<<29;

int main(){
    ll n,q;
    cin >> n >> q;
    vector<ll> a(n),b(n+1,0l);
    rep(i,n) cin >> a[i];
    char c;
    ll x,y;
    rep(i,q){
        cin >> c >> x >> y;
        if (c-'A'){
            for (int j=x;j<=y;j++) b[j] += a[j-1];
        }
        else a[x-1] += y;
    }
    for (int i=1;i<=n;i++) printf("%ld ",b[i]);
    cout << endl;
    return 0;
}
0