Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
121372 陈道宁 序列变换 C++ 通过 100 350 MS 4164 KB 376 2024-01-21 17:09:50

Tests(10/10):


#include<bits/stdc++.h> #include<stdio.h> using namespace std; int a[1000005]; int n,m; int main(){ cin>>n>>m; for(int i=1;i<=n;i++){ cin>>a[i]; } int temp,x,y; for(int i=0;i<m;i++){ cin>>temp; if(temp==1){ cin>>x>>y; int i=1; while(x*i<=n){ a[x*i]+=y; i++; } } if(temp==2){ cin>>x; cout<<a[x]<<endl; } } }


测评信息: