QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#652800#1842. Mathjiangzhihui#Compile Error//C++20715b2024-10-18 19:09:512024-10-18 19:09:53

Judging History

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

  • [2024-10-18 19:09:53]
  • 评测
  • [2024-10-18 19:09:51]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1919810;
typedef long long ll;
typedef pair<ll,ll> PII;
ll n,m,k;
ll a[N],b[N];
char s[N];
ll cnt[N];
int num[N];

void __(){
    scanf("%lld",&n);
    for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
    sort(a+1,a+1+n,greater<ll>());
    ll ans=a[1];
    for(int i=1;i<=n;i++){
        ll t=a[i];
        if((t&ans)!=t){
            puts("-1");
            return;
        }
        ans&=t;
    }
    printf("%lld\n",n);
    for(int i=1;i<=n;i++) printf("%lld ",a[i]);
    printf("\n"); 
}


int main(){
    int _=1;
    cin>>_;
    while(_--){
        __();
    }
}

Details

answer.code:13:1: error: extended character   is not valid in an identifier
   13 |     scanf("%lld",&n);
      | ^
answer.code:13:3: error: extended character   is not valid in an identifier
   13 |     scanf("%lld",&n);
      |   ^
answer.code:14:1: error: extended character   is not valid in an identifier
   14 |     for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
      | ^
answer.code:14:3: error: extended character   is not valid in an identifier
   14 |     for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
      |   ^
answer.code:15:1: error: extended character   is not valid in an identifier
   15 |     sort(a+1,a+1+n,greater<ll>());
      | ^
answer.code:15:3: error: extended character   is not valid in an identifier
   15 |     sort(a+1,a+1+n,greater<ll>());
      |   ^
answer.code:16:1: error: extended character   is not valid in an identifier
   16 |     ll ans=a[1];
      | ^
answer.code:16:3: error: extended character   is not valid in an identifier
   16 |     ll ans=a[1];
      |   ^
answer.code:17:1: error: extended character   is not valid in an identifier
   17 |     for(int i=1;i<=n;i++){
      | ^
answer.code:17:3: error: extended character   is not valid in an identifier
   17 |     for(int i=1;i<=n;i++){
      |   ^
answer.code:18:1: error: extended character   is not valid in an identifier
   18 |         ll t=a[i];
      | ^
answer.code:18:3: error: extended character   is not valid in an identifier
   18 |         ll t=a[i];
      |   ^
answer.code:18:5: error: extended character   is not valid in an identifier
   18 |         ll t=a[i];
      |     ^
answer.code:18:7: error: extended character   is not valid in an identifier
   18 |         ll t=a[i];
      |       ^
answer.code:19:1: error: extended character   is not valid in an identifier
   19 |         if((t&ans)!=t){
      | ^
answer.code:19:3: error: extended character   is not valid in an identifier
   19 |         if((t&ans)!=t){
      |   ^
answer.code:19:5: error: extended character   is not valid in an identifier
   19 |         if((t&ans)!=t){
      |     ^
answer.code:19:7: error: extended character   is not valid in an identifier
   19 |         if((t&ans)!=t){
      |       ^
answer.code:20:1: error: extended character   is not valid in an identifier
   20 |             puts("-1");
      | ^
answer.code:20:3: error: extended character   is not valid in an identifier
   20 |             puts("-1");
      |   ^
answer.code:20:5: error: extended character   is not valid in an identifier
   20 |             puts("-1");
      |     ^
answer.code:20:7: error: extended character   is not valid in an identifier
   20 |             puts("-1");
      |       ^
answer.code:20:9: error: extended character   is not valid in an identifier
   20 |             puts("-1");
      |         ^
answer.code:20:11: error: extended character   is not valid in an identifier
   20 |             puts("-1");
      |           ^
answer.code:21:1: error: extended character   is not valid in an identifier
   21 |             return;
      | ^
answer.code:21:3: error: extended character   is not valid in an identifier
   21 |             return;
      |   ^
answer.code:21:5: error: extended character   is not valid in an identifier
   21 |             return;
      |     ^
answer.code:21:7: error: extended character   is not valid in an identifier
   21 |             return;
      |       ^
answer.code:21:9: error: extended character   is not valid in an identifier
   21 |             return;
      |         ^
answer.code:21:11: error: extended character   is not valid in an identifier
   21 |             return;
      |           ^
answer.code:22:1: error: extended character   is not valid in an identifier
   22 |         }
      | ^
answer.code:22:3: error: extended character   is not valid in an identifier
   22 |         }
      |   ^
answer.code:22:5: error: extended character   is not valid in an identifier
   22 |         }
      |     ^
answer.code:22:7: error: extended character   is not valid in an identifier
   22 |         }
      |       ^
answer.code:23:1: error: extended character   is not valid in an identifier
   23 |         ans&=t;
      | ^
answer.code:23:3: error: extended character   is not valid in an identifier
   23 |         ans&=t;
      |   ^
answer.code:23:5: error: extended character   is not valid in an identifier
   23 |         ans&=t;
      |     ^
answer.code:23:7: error: extended character   is not valid in an identifier
   23 |         ans&=t;
      |       ^
answer.code:24:1: error: extended character   is not valid in an identifier
   24 |     }
      | ^
answer.code:24:3: error: extended character   is not valid in an identifier
   24 |     }
      |   ^
answer.code:25:1: error: extended character   is not valid in an identifier
   25 |     printf("%lld\n",n);
      | ^
answer.code:25:3: error: extended character   is not valid in an identifier
   25 |     printf("%lld\n",n);
      |   ^
answer.code:26:1: error: extende...