QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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();
}
}
Details
answer.code: In function ‘void solve()’: answer.code:35:12: error: ‘c’ was not declared in this scope 35 | return;c | ^