QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#568088#9308. World Cupwsy123wsy#WA 1ms3632kbC++141.3kb2024-09-16 15:11:422024-09-16 15:11:43

Judging History

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

  • [2024-09-16 15:11:43]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3632kb
  • [2024-09-16 15:11:42]
  • 提交

answer

#include <iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<list>
#include<deque>
#include<cstdio>
#include<string>
#include<regex>
#include<fstream>
using namespace std;
#define lowbit(x) ((x)&-(x))
#define ll long long
#define ull unsigned long long
ll read()
{
	ll x=0;char ch=getchar();
	while(ch<'0'||ch>'9')ch=getchar();
	while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return x;
}

int n,t;
struct Li{
	int v,id;
} a[33];
bool cmp(Li x,Li y)
{
	return x.v>y.v;
}
bool f32(int pi)
{
	if(pi>30) return 1;
	return 0;
}
bool f16(int pi)
{
	if(pi>26) return 1;
	return 0;
}
bool f8(int pi)
{
	if(pi>18) return 1;
	return 0;
}
bool f4(int pi)
{
	if(pi>2) return 1;
	return 0;
}
bool f2(int pi)
{
	if(pi>1) return 1;
	return 0;
}
bool f1(int pi)
{
	if(pi==1) return 1;
	return 0;
}
int main()
{
	cin>>t;
	while(t--)
	{
		for(int i=1;i<=32;i++)
		{
			cin>>a[i].v;
			a[i].id=i;
		}
		sort(a+1,a+1+n,cmp);
		int pi=0;
		for(int i=1;i<=32;i++)
		{
			if(a[i].id==1) pi=i;
		}
		if(f32(pi)) cout<<32<<endl;
		else if(f16(pi)) cout<<16<<endl;
		else if(f8(pi)) cout<<8<<endl;
		else if(f4(pi)) cout<<4<<endl;
		else if(f2(pi)) cout<<2<<endl;
		else if(f1(pi)) cout<<1<<endl;
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3624kb

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:

1

result:

ok 1 number(s): "1"

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3632kb

input:

32
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
4 1 2 3 5 6 7 8 9 10 11 12 13 14 15 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

wrong answer 1st numbers differ - expected: '32', found: '1'