#include <bits/stdc++.h> using namespace std; int main(int argc, char** argv) { int m,n,a[n]; cin>>n>>m; int x,y,ans,j,k[n]; for(int i=1;i<=n;i++ ){ cin>>a[i]; } for(int i=0;i<m;i++ ){ cin>>ans; if(ans==1){ cin>>x>>y; for(int k=1;k*x<=n;k++){ a[k*x]+=y; } } if(ans==2){ cin>>j; cout<<a[j]<<endl; } } return 0; }
标签:std,变换,cin,int,ans,序列 From: https://www.cnblogs.com/hanxuyao/p/17563946.html