QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#456219#7112. XOR Cliqueucup-team3282#WA 7ms3652kbC++14487b2024-06-27 15:01:202024-06-27 15:01:20

Judging History

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

  • [2024-06-27 15:01:20]
  • 评测
  • 测评结果:WA
  • 用时:7ms
  • 内存:3652kb
  • [2024-06-27 15:01:20]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 5e5+9;
int a[N];

signed main() {
	int T; cin >> T;
	while (T--) {
		int n; cin >> n;
		for (int i = 1; i <= n; i++) cin >> a[i];
		int ans = 1;
		for (int i = 0; i < 31; i++) {
			int res = 0;
			for (int j = 1; j <= n; j++) {
				if (((1 << i) & a[j]) && a[j] < (1 << (j + 1))) {
					res++;
				}
			}
			
			ans = max(ans, res);
		}
		
		cout << ans << "\n";
	}
	return 0;	
}

详细

Test #1:

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

input:

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

output:

2
3
2

result:

ok 3 number(s): "2 3 2"

Test #2:

score: -100
Wrong Answer
time: 7ms
memory: 3652kb

input:

10000
10
10 8 8 8 8 2 5 4 8 7
10
8 9 3 2 7 10 3 10 3 10
10
2 10 10 4 10 10 10 1 5 10
10
4 4 1 4 10 3 4 6 4 6
10
7 3 4 5 9 4 4 7 8 8
10
8 6 5 1 6 2 7 3 7 4
10
2 8 7 3 10 5 1 6 8 3
10
6 4 7 4 10 4 8 5 7 6
10
8 5 5 3 8 1 9 10 8 9
10
10 8 10 8 3 6 10 8 2 6
10
10 7 4 10 1 8 4 6 2 3
10
9 10 4 2 7 5 5 4 4 ...

output:

4
8
6
6
5
6
6
7
6
6
5
7
7
6
7
7
4
6
6
5
6
6
7
6
7
5
7
5
6
7
6
7
5
7
8
8
6
5
6
6
6
5
6
6
6
5
8
7
5
7
5
5
6
5
6
5
6
5
5
5
7
5
5
7
5
6
8
3
5
5
8
8
6
5
4
6
5
4
6
5
7
4
7
7
6
6
8
6
6
10
4
6
6
5
5
6
6
6
6
6
7
7
5
4
4
4
6
5
7
5
6
6
6
7
5
6
6
7
9
9
4
6
4
4
7
6
5
6
5
6
5
5
7
6
5
8
5
7
6
8
4
5
4
5
5
5
6
6
7
6...

result:

wrong answer 1st numbers differ - expected: '6', found: '4'