QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#684110#9531. Weird Ceilingxiojoy#Compile Error//C++20691b2024-10-28 10:38:052024-10-28 10:38:05

Judging History

你现在查看的是最新测评结果

  • [2024-10-28 10:38:05]
  • 评测
  • [2024-10-28 10:38:05]
  • 提交

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
      |            ^