QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#568267#9308. World CupcuteWA 1ms3608kbC++141.8kb2024-09-16 15:48:262024-09-16 15:48:27

Judging History

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

  • [2024-09-16 15:48:27]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3608kb
  • [2024-09-16 15:48:26]
  • 提交

answer

#include <bits/stdc++.h>
#define x first
#define y second

using namespace std;


void solve(){
	int a32[33], a16[17], aa16[17], a8[9],a4[5],a2[3],a1[2];
	for(int i = 1 ; i <= 32; i++)cin >> a32[i];
	int idx = 1;
	vector<int> b;
	for(int i = 1; i <= 32; i++){		
		b.push_back(a32[i]);			
		if(i%4 == 0){
			sort(b.begin(), b.end());			
			
			aa16[idx++] = b[3];
			aa16[idx++] = b[2];
			//cout << b[3] << " "<<b[2]<<endl;
			b.clear();
		}
	}
	
	a16[1] = aa16[1];
	a16[2] = aa16[4];
	a16[3] = aa16[5];	
	a16[4] = aa16[8];
	a16[5] = aa16[9];
	a16[6] = aa16[12];
	a16[7] = aa16[13];
	a16[8] = aa16[16];
	a16[9] = aa16[2];
	a16[10] = aa16[3];
	a16[11] = aa16[6];
	a16[12] = aa16[7];
	a16[13] = aa16[10];
	a16[14] = aa16[11];
	a16[15] = aa16[14];
	a16[16] = aa16[15];
	
  	for(int i = 1, j = 1; i <= 8; i++){
  		a8[i] = max(a16[j], a16[j+1]);
  		j+=2; 
  		//cout << a8[i] << " ";
	  }
	 // cout << endl;
	for(int i = 1, j = 1; i <= 4; i++){
		a4[i] = max(a8[j], a8[j+1]);
		j+=2;
		//cout << a4[i] << " ";
	}
	//cout << endl;
	for(int i = 1, j = 1; i <= 2; i++){
		a2[i] = max(a4[j], a4[j+1]);
		j+=2;
	//	cout << a2[i] << " ";
	}
	//cout << endl;
	int flag = a32[1];
	a1[1] = max(a2[1], a2[2]);
	//cout << a1[1] << " ";
	//cout << endl;
	if(a1[1] == flag){
		cout << 1 <<endl;
		return;
	}
	if(a2[1] == flag || a2[2] == flag){
		cout << 2 <<endl;
		return;
	}
	for(int i =1; i<= 4; i++){
		if(flag == a4[i]){
			cout << 4 <<endl;
			return;
		}
	}
	for(int i = 1; i <= 8; i++){
		if(flag == a8[i]){
			cout << 8 <<endl;
			return;
		}
		
	}
	for(int i = 1; i <= 16; i++){
		if(flag == a16[i]){
			cout << 16<<endl;
			return;
		}
	}
	cout << 32 <<endl;
	return;
	
}


int main() {
	int t;
	cin >> t;
	while(t--){
		solve();
	}
	return 0;
}

詳細信息

Test #1:

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

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: 3608kb

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
16
16
8
8
8
8
8
8
8
8
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
2
1

result:

wrong answer 14th numbers differ - expected: '4', found: '8'