QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#567258 | #9308. World Cup | mingzi123# | WA | 0ms | 3828kb | C++17 | 1.2kb | 2024-09-16 10:38:08 | 2024-09-16 10:38:09 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
void solve()
{
int a[50]={0};
vector<int> b;
vector<int> g16;
vector<int> g8;
vector<int> g4;
vector<int> g2;
vector<int> g1;
for(int i=1;i<=32;i++)
{
cin>>a[i];
b.push_back(a[i]);
if(i%4==0)
{
sort(b.begin(),b.end());
g16.push_back(b[3]);
g16.push_back(b[2]);
b.clear();
}
}
for(int i=0;i<16;i+=4)
g8.push_back(max(g16[i],g16[i+3]));
for(int i=1;i<16;i+=4)
g8.push_back(max(g16[i],g16[i+1]));
for(int i=0;i<8;i+=2)
g4.push_back(max(g8[i],g8[i+1]));
for(int i=0;i<4;i+=2)
g2.push_back(max(g4[i],g4[i+1]));
g1.push_back(max(g2[0],g2[1]));
for(int i=0;i<16;i++)
cout<<g16[i]<<" ";
cout<<endl;
for(int i=0;i<8;i++)
cout<<g8[i]<<" ";
cout<<endl;
if(g1[0]==a[1])
{
cout<<"1\n";
return;
}
if(g2[0]==a[1] || g2[1]==a[1])
{
cout<<"1\n";
return;
}
for(int i=0;i<4;i++)
{
if(g4[i]==a[i])
{
cout<<"4\n";
return;
}
}
for(int i=0;i<8;i++)
{
if(g8[i]==a[i])
{
cout<<"8\n";
return;
}
}
for(int i=0;i<16;i++)
{
if(g16[i]==a[i])
{
cout<<"16\n";
return;
}
}
cout<<"32\n";
}
int main()
{
int t=1;
cin>>t;
while(t--)
solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3828kb
input:
1 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
output:
32 31 28 27 24 23 20 19 16 15 12 11 8 7 4 3 32 24 16 8 31 23 15 7 1
result:
wrong answer 1st numbers differ - expected: '1', found: '32'