cf Sereja and Array
2014-04-14 20:49
387 查看
http://codeforces.com/contest/315/problem/B
View Code
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #define maxn 200000 using namespace std; int a[maxn],b[maxn],c,v,x; int main() { int n,m; cin>>n>>m; for(int i=0; i<n; i++) { cin>>a[i]; } int ans=0; for(int i=0; i<m; i++) { cin>>c; if(c==1) { cin>>v>>x; a[v-1]=x-ans; } else if(c==2) { cin>>x; ans+=x; } else if(c==3) { cin>>v; cout<<a[v-1]+ans<<endl; } } return 0; }
View Code
相关文章推荐
- CF_315B_Sereja and Array
- CF 315B - Sereja and Array(树状数组)
- Sereja and Array-数组操作或者线段树或树状数组
- CF_314D_Sereja and Periods
- 【CF】220B Little Elephant and Array
- CF-Sereja and Algorithm
- cf 442C. Artem and Array
- codeforces 315 B.Sereja and Array(线段树区间更新+单点更新+单点询问)
- CF--B. Wilbur and Array
- CF 558B(Amr and The Large Array-计数)
- CF 439C(251C题)Devu and Partitioning of the Array
- Codeforces Round #187 (Div. 2) B. Sereja and Array
- CF380A Sereja and Prefixes
- codeforces 315 B.Sereja and Array
- CF 380C - Sereja and Brackets(线段树)
- CF 558B(Amr and The Large Array-计数)
- 水题(Maxim and Array,cf 721D)
- CF_315A_Sereja and Bottles
- codeforces 315 B.Sereja and Array
- B. Sereja and Array