QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#571019#9308. World CupHorizonblackWA 0ms3768kbC++141.0kb2024-09-17 19:54:462024-09-17 19:54:48

Judging History

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

  • [2024-09-17 19:54:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3768kb
  • [2024-09-17 19:54:46]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define ll long long
#define maxn 33
using namespace std;
template <typename T>inline void read(T &x){
	x=0;
	bool res=0;
	char c=getchar();
	while(!isdigit(c)){
		if(c=='-') res=1;
		c=getchar();
	}
	while(isdigit(c)){
		x=(x<<1)+(x<<3)+(c^'0');
		c=getchar();
	}
	if(res) x=(~x)+1;
	return;
}
template <typename T>inline void wr(T x){
	if(x<0){
		putchar('-');
		x=-x;
	}
	if(x>9) wr(x/10);
	putchar((x%10)+'0');
	return; 
}
int a[maxn],t,cnt;
int main(){
	read(t);
	while(t--){
		for(int i=1;i<=32;i++){
			read(a[i]);
		}
		sort(a+2,a+33);
		if(a[32]<a[1]){
			printf("1\n");
			continue;
		}
		for(int i=2;i<=32;i++){
			if(a[i]>a[1]){
				cnt=i-1;
				break;
			}
		}
		if(cnt<3){
			printf("32\n");
		}
		else if(cnt==3||cnt==4){
			printf("16\n");
		}
		else if(cnt==5||cnt==6){
			printf("8\n");
		}
		else if(cnt>=7&&cnt<=15){
			printf("4\n");
		}
		else{
			printf("2\n");
		}
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3708kb

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: 0ms
memory: 3768kb

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:

32
32
16
16
8
8
4
4
4
4
4
4
4
4
4
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1

result:

wrong answer 5th numbers differ - expected: '16', found: '8'