QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#759793#9308. World CupcbbdhzCompile Error//C++201.0kb2024-11-18 12:09:552024-11-18 12:09:58

Judging History

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

  • [2024-11-18 12:09:58]
  • 评测
  • [2024-11-18 12:09:55]
  • 提交

answer

 #include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=40;
int v[N];
void solve()
{
     int  n=32;
     for(int i=1;i<=n;i++)
      {
        cin>>v[i];
       }
     
        int ans=0;
         for(int i=1;i<=n;i++)
         {
             if(v[i]>=v[1])//我是第几名
             {
               ans++;
             }    
         }  
         if(ans==1)
         {
            cout<<1<<endl;
         }else if(ans<=17)
         {
            cout<<2<<endl;
         }else if(ans<=25)
         {
            cout<<4<<endl;
         }else if(ans<=29)
         {
            cout<<8<<endl;
         }else if(ans<=31)
         [
            cout<<16<<endl;
         ]else{
            cout<32<<endl;
         }

}
signed main()
{
#ifdef ONLINE_JUDGE
#else
    freopen("in.in","r",stdin);
    freopen("out.out","w",stdout);
#endif
    ios::sync_with_stdio(false);cin.tie(0);
    int T;cin>>T;
    while(T--)
    {
        solve();
    }
   

}

詳細信息

answer.code: In function ‘void solve()’:
answer.code:36:13: warning: capture of variable ‘std::cout’ with non-automatic storage duration
   36 |             cout<<16<<endl;
      |             ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:146,
                 from answer.code:1:
/usr/include/c++/13/iostream:63:18: note: ‘std::ostream std::cout’ declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
answer.code:36:17: error: expected ‘,’ before ‘<<’ token
   36 |             cout<<16<<endl;
      |                 ^~
      |                 ,
answer.code:36:17: error: expected identifier before ‘<<’ token
   36 |             cout<<16<<endl;
      |                 ^~
answer.code:36:27: error: expected ‘]’ before ‘;’ token
   36 |             cout<<16<<endl;
      |                           ^
      |                           ]
answer.code: In lambda function:
answer.code:36:27: error: expected ‘{’ before ‘;’ token
answer.code: In function ‘void solve()’:
answer.code:37:10: error: expected primary-expression before ‘]’ token
   37 |          ]else{
      |          ^