QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#684110 | #9531. Weird Ceiling | xiojoy# | Compile Error | / | / | C++20 | 691b | 2024-10-28 10:38:05 | 2024-10-28 10:38:05 |
Judging History
answer
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int T;
int n;
ll sum;
const int N = 2e5+10;
int a[N];
int b[N];
int cnt,cnt1;
void solve()
{
cnt=0;
cnt1=0;
sum=0;
cin>>n;
for(int i=2;i*i<=n;i++){
if(n%i==0){
a[++cnt]=i;
if(i!=n/i) b[++cnt1]=n/i;
}
}
for(int i=cnt1;i>=1;i--){
a[++cnt]=b[i];
}
a[++cnt]=n;
int now=1;
for(int i=1;i<=cnt;i++){
ll tem = n/now;
sum+=1ll*(a[i]-now)*tem;
now=a[i];
}
sum+=1;
cout<<sum<<'\n';
return;c
}
int main()
{
cin>>T;
while(T--){
solve();
}
}
詳細信息
answer.code: In function ‘void solve()’: answer.code:35:12: error: ‘c’ was not declared in this scope 35 | return;c | ^