QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#187737#7112. XOR CliqueUrgantTeam#RE 0ms0kbC++23815b2023-09-24 21:35:242023-09-24 21:35:24

Judging History

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

  • [2023-09-24 21:35:24]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2023-09-24 21:35:24]
  • 提交

answer

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <array>
#include <vector>
#include <tuple>
#include <algorithm>
#include <cstdint>

using namespace std;

using vi = vector<int>;

int find_ans(const vi& v) {
	vi u(32);
	for (int i : v) {
		int j;
		for (j = 31; j >= 0; --j)
			if (i & 1 << j)
				break;
		++u[j];
	}
	return *max_element(u.begin(), u.end());
}

bool solve_test() {
	int n;
	if (!(cin >> n))
		return false;
	vi a(n);
	for (int& i : a)
		cin >> i;
	cout << find_ans(a) << '\n';
	return true;
}

void solve_tests() {
	int t;
	cin >> t;
	for (int i = 0; i < t; ++i)
		solve_test();
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	solve_tests();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Dangerous Syscalls

input:

3
3
1 2 3
3
1 1 1
5
1 2323 534 534 5

output:


result: