結果
問題 |
No.1000 Point Add and Array Add
|
ユーザー |
![]() |
提出日時 | 2020-02-29 21:24:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 544 bytes |
コンパイル時間 | 1,418 ms |
コンパイル使用メモリ | 168,588 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-10-13 20:19:20 |
合計ジャッジ時間 | 5,914 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 TLE * 1 -- * 7 |
ソースコード
#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; }