Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
122124 | 秦炜杰 | 序列变换 | C++ | 解答错误 | 10 | 2001 MS | 4156 KB | 341 | 2024-01-22 14:04:27 |
#include<bits/stdc++.h> using namespace std; int n,m,a[1000010]; int main(){ cin>>n>>m; for(int i=1;i<=n;i++) cin>>a[i]; int t,x,y; for(int i=1;i<=m;i++){ cin>>t; if(t==1){ cin>>x>>y; for(int j=1;j<=n;j++){ if(a[j]%x==0) a[j]+=y; } } if(t==2){ cin>>x; cout<<a[x]<<endl; } } return 0; }