QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#568960 | #9308. World Cup | acmlx21 | WA | 0ms | 3628kb | C++20 | 2.5kb | 2024-09-16 19:32:15 | 2024-09-16 19:32:17 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<long long, long long> pll;
int cmp(int a, int b)
{
return a > b ? a : b;
}
void solve()
{
int t;
cin >> t;
int arr[8][4];
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 4; j++)
{
cin >> arr[i][j];
}
}
int china = arr[0][0];
sort(arr[0], arr[0] + 4);
if (arr[0][3] != china && arr[0][2] != china)
{
cout << 32 << endl;
}
else
{
for (int i = 1; i < 8; i++)
{
sort(arr[i], arr[i] + 4);
}
int a1 = arr[0][3], a2 = arr[0][2];
int b1 = arr[1][3], b2 = arr[1][2];
int c1 = arr[2][3], c2 = arr[2][2];
int d1 = arr[3][3], d2 = arr[3][2];
int e1 = arr[4][3], e2 = arr[4][2];
int f1 = arr[5][3], f2 = arr[5][2];
int g1 = arr[6][3], g2 = arr[6][2];
int h1 = arr[7][3], h2 = arr[7][2];
int nums[15];
nums[0] = cmp(a1, b2);
if (nums[0] != china)
{
cout << 16 << endl;
}
else
{
nums[1] = cmp(c1, d2);
nums[2] = cmp(e1, f2);
nums[3] = cmp(g1, h2);
nums[4] = cmp(a2, b1);
nums[5] = cmp(c2, d1);
nums[6] = cmp(e2, f1);
nums[7] = cmp(g2, h1);
nums[8] = cmp(nums[0], nums[1]);
if (nums[8] != china)
{
cout << 8 << endl;
}
else
{
nums[9] = cmp(nums[2], nums[3]);
nums[10] = cmp(nums[4], nums[5]);
nums[11] = cmp(nums[6], nums[7]);
nums[12] = cmp(nums[8], nums[9]);
if (nums[12] != china)
{
cout << 4 << endl;
}
else
{
nums[13] = cmp(nums[10], nums[11]);
nums[14] = cmp(nums[12], nums[13]);
if (nums[14] != china)
{
cout << 2 << endl;
}
else
{
cout << 1 << endl;
}
}
}
}
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ll t;
cin >> t;
while (t--)
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3628kb
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:
2
result:
wrong answer 1st numbers differ - expected: '1', found: '2'