QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#759793 | #9308. World Cup | cbbdhz | Compile Error | / | / | C++20 | 1.0kb | 2024-11-18 12:09:55 | 2024-11-18 12:09:58 |
Judging History
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();
}
}
Details
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{ | ^