Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
121427 蒋沛霖 猫和老鼠 C++ 解答错误 0 0 MS 244 KB 402 2024-01-21 17:33:44

Tests(0/10):


#include<bits/stdc++.h> using namespace std; int n; int m; long long a[1000010]; int x; int y; int main() { cin>>n; cin>>m; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=m;i++) { cin>>x; if(x==1) { cin>>x; cin>>y; for(int j=x;j<=n;j=j+x) { a[j]+=y; } } else { cin>>x; cout<<a[x]; cout<<endl; } } return 0; }


测评信息: