QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#565555#9308. World Cupoyasumi_sionWA 0ms3568kbC++20867b2024-09-15 21:40:012024-09-15 21:40:01

Judging History

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

  • [2024-09-15 21:40:01]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3568kb
  • [2024-09-15 21:40:01]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

void solve() {
	std::vector<int> a(31);
	int cn;
	std::cin >> cn;
	for (int i = 0; i < 31; i++) {
		std::cin >> a[i];
	}

	std::sort(a.begin(), a.end());
	// a[2] > a[1] > a[0]
	// cn 小组第一
	// c1 = a[10], c2 = a[9], d1 = a[14], d2 =a[13], e1 = a[18], f1 = a[22], g1 = a[26], h1 = a[30],
	int ans = 32;
	if (cn > a[2]) {
		// b2 = a[5], b1 = a[6];
		ans = 16;
		if (cn > a[5]) {
			ans = 8;
			if (cn > a[13]) {
				ans = 4;
				// a1, h2, d1, h1
				if (cn > a[29]) {
					ans = 2;
					if (cn > a[30]) {
						ans = 1;
					}
				}
			}
		}
	} else if (cn > a[1]) {
		ans = 16;
	}

	std::cout << ans << '\n';
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int t = 1;
	std::cin >> t;

	while (t--) {
		solve();
	}

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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'