QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#574720#9308. World Cuplolid_ddfCompile Error//C++20782b2024-09-19 00:04:032024-09-19 00:04:03

Judging History

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

  • [2024-09-19 00:04:03]
  • 评测
  • [2024-09-19 00:04:03]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef float f;
int lowbit(int x){return x&-x;}
void solve()
{
    int a[35];
    for(int i=1;i<=32;i++)
    {
        cin>>a[i];
    }
    int count=a[1];
    sort(a+1,a+33,greater<int>());
    for(int i=1;i<=32;i++)
    {
        if(a[i]==count){count=i;break;}
    }1
    if(count==1)cout<<1;
    else if(count>=2&&count<=5)cout<<2<<endl;
    else if(count>=6&&count<=19)cout<<4<<endl;
    else if(count>=20&&count<=26)cout<<8<<endl;
    else if(count>=27&&count<=30)cout<<16<<endl;
    else cout<<32<<endl;
}

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t;
    //t=1;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0 ;
}

詳細信息

answer.code: In function ‘void solve()’:
answer.code:18:7: error: expected ‘;’ before ‘if’
   18 |     }1
      |       ^
      |       ;
   19 |     if(count==1)cout<<1;
      |     ~~ 
answer.code:20:5: error: ‘else’ without a previous ‘if’
   20 |     else if(count>=2&&count<=5)cout<<2<<endl;
      |     ^~~~