QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#748189#9531. Weird Ceilingproking#Compile Error//C++14618b2024-11-14 19:36:192024-11-14 19:36:22

Judging History

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

  • [2024-11-14 19:36:22]
  • 评测
  • [2024-11-14 19:36:19]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[100005],top=0;
void solve(ll n){
    top=0;ll sum=1;
    for(ll i=1;i*i<=n;i++)
    if(n%i==0){
        a[++top]=i;
        int j=n/i;
        if(i!=j)a[++top]=j;
    }
    sort(a+1,a+top+1);
    for(int i=1;i<top;i++){
        sum+=(a[i+1]-a[i])*(n/a[i]);
        //cout<<a[i]<<';';
    }
    cout<<sum<<endl;
}  
int main(){
    int T;cin>>T;
    while(T--){
        ll x;
        cin>>x;
        //x=rand()*rand();
        solve(x);
    }
    return 0;
}

详细

answer.code:6:1: error: extended character   is not valid in an identifier
    6 |     top=0;ll sum=1;
      | ^
answer.code:6:3: error: extended character   is not valid in an identifier
    6 |     top=0;ll sum=1;
      |   ^
answer.code:7:1: error: extended character   is not valid in an identifier
    7 |     for(ll i=1;i*i<=n;i++)
      | ^
answer.code:7:3: error: extended character   is not valid in an identifier
    7 |     for(ll i=1;i*i<=n;i++)
      |   ^
answer.code:8:1: error: extended character   is not valid in an identifier
    8 |     if(n%i==0){
      | ^
answer.code:8:3: error: extended character   is not valid in an identifier
    8 |     if(n%i==0){
      |   ^
answer.code:9:1: error: extended character   is not valid in an identifier
    9 |         a[++top]=i;
      | ^
answer.code:9:3: error: extended character   is not valid in an identifier
    9 |         a[++top]=i;
      |   ^
answer.code:9:5: error: extended character   is not valid in an identifier
    9 |         a[++top]=i;
      |     ^
answer.code:9:7: error: extended character   is not valid in an identifier
    9 |         a[++top]=i;
      |       ^
answer.code:10:1: error: extended character   is not valid in an identifier
   10 |         int j=n/i;
      | ^
answer.code:10:3: error: extended character   is not valid in an identifier
   10 |         int j=n/i;
      |   ^
answer.code:10:5: error: extended character   is not valid in an identifier
   10 |         int j=n/i;
      |     ^
answer.code:10:7: error: extended character   is not valid in an identifier
   10 |         int j=n/i;
      |       ^
answer.code:11:1: error: extended character   is not valid in an identifier
   11 |         if(i!=j)a[++top]=j;
      | ^
answer.code:11:3: error: extended character   is not valid in an identifier
   11 |         if(i!=j)a[++top]=j;
      |   ^
answer.code:11:5: error: extended character   is not valid in an identifier
   11 |         if(i!=j)a[++top]=j;
      |     ^
answer.code:11:7: error: extended character   is not valid in an identifier
   11 |         if(i!=j)a[++top]=j;
      |       ^
answer.code:12:1: error: extended character   is not valid in an identifier
   12 |     }
      | ^
answer.code:12:3: error: extended character   is not valid in an identifier
   12 |     }
      |   ^
answer.code:13:1: error: extended character   is not valid in an identifier
   13 |     sort(a+1,a+top+1);
      | ^
answer.code:13:3: error: extended character   is not valid in an identifier
   13 |     sort(a+1,a+top+1);
      |   ^
answer.code:14:1: error: extended character   is not valid in an identifier
   14 |     for(int i=1;i<top;i++){
      | ^
answer.code:14:3: error: extended character   is not valid in an identifier
   14 |     for(int i=1;i<top;i++){
      |   ^
answer.code:15:1: error: extended character   is not valid in an identifier
   15 |         sum+=(a[i+1]-a[i])*(n/a[i]);
      | ^
answer.code:15:3: error: extended character   is not valid in an identifier
   15 |         sum+=(a[i+1]-a[i])*(n/a[i]);
      |   ^
answer.code:15:5: error: extended character   is not valid in an identifier
   15 |         sum+=(a[i+1]-a[i])*(n/a[i]);
      |     ^
answer.code:15:7: error: extended character   is not valid in an identifier
   15 |         sum+=(a[i+1]-a[i])*(n/a[i]);
      |       ^
answer.code:16:1: error: extended character   is not valid in an identifier
   16 |         //cout<<a[i]<<';';
      | ^
answer.code:16:3: error: extended character   is not valid in an identifier
   16 |         //cout<<a[i]<<';';
      |   ^
answer.code:16:5: error: extended character   is not valid in an identifier
   16 |         //cout<<a[i]<<';';
      |     ^
answer.code:16:7: error: extended character   is not valid in an identifier
   16 |         //cout<<a[i]<<';';
      |       ^
answer.code:17:1: error: extended character   is not valid in an identifier
   17 |     }
      | ^
answer.code:17:3: error: extended character   is not valid in an identifier
   17 |     }
      |   ^
answer.code:18:1: error: extended character   is not valid in an identifier
   18 |     cout<<sum<<endl;
      | ^
answer.code:18:3: error: extended character   is not valid in an identifier
   18 |     cout<<sum<<endl;
      |   ^
answer.code:19:3: error: extended character   is not valid in an identifier
   19 | }  
      |   ^
answer.code:21:1: error: extended character   is not valid in an identifier
   21 |     int T;cin>>T;
      | ^
answer.code:21:3: error: extended character   is not valid in an identifier
   21 |     int T;cin>>T;
      |   ^
answer.code:22:1: error: extended character   is not valid in an identifier
   22 |     while(T--){
      | ^
answer.code:22:3: error: extended character   is not valid in an identifier
   22 |     while(T--){
      |   ^
answer.code:23:1: error: extended character   is not valid in an identifier
   23 |         ll x;
      | ^
answer.code:23:3: error: extended character   is not valid in an identifier
...