QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#164939 | #7112. XOR Clique | ucup-team1329 | WA | 5ms | 3832kb | C++11 | 926b | 2023-09-05 14:51:55 | 2023-09-05 14:51:55 |
Judging History
answer
#include <bits/stdc++.h>
#define endl '\n'
#define i64 long long
#define lg(x) ((int)log10(x))
#define log(x) ((int)log2(x))
#define PII std::pair<int, int>
#define init_0(x) memset(x, 0, sizeof(x))
#define init_inf(x) memset(x, 0x3f, sizeof(x))
inline i64 read() {
bool sym = 0; i64 res = 0; char ch = getchar();
while (!isdigit(ch)) sym |= (ch == '-'), ch = getchar();
while (isdigit(ch)) res = (res << 3) + (res << 1) + (ch ^ 48), ch = getchar();
return sym ? -res : res;
}
const int N = 2e5, mod = 998244353, inf = 0x3f3f3f3f;
void solve() {
int n = read();
std::vector<int> a(n + 1);
for (int i = 1; i <= n; i++) a[i] = read();
int ans = 0;
for (int i = 1; i <= n; i++) {
int x = i;
while (x < n && log(a[x + 1]) == log(a[i])) x++;
ans = std::max(ans, x - i + 1);
i = x;
}
printf("%d\n", ans);
}
int main() {
int T = read();
while (T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3756kb
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: 5ms
memory: 3832kb
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:
5 2 3 4 3 2 1 4 4 4 2 6 2 2 2 3 2 4 3 4 3 2 2 2 4 2 1 2 4 3 2 5 3 3 3 3 4 3 1 2 3 3 2 3 3 2 2 5 3 2 2 2 2 2 4 2 3 2 3 1 2 2 2 1 2 3 1 2 2 2 2 5 2 3 2 3 4 3 2 2 3 3 2 4 2 2 4 2 2 3 3 2 3 2 3 3 2 3 2 2 5 2 2 5 3 2 3 3 3 2 2 3 5 6 3 3 1 2 9 2 2 2 2 2 2 2 2 3 2 2 3 2 2 4 3 3 3 2 3 3 3 2 2 2 2 4 3 2 4 3 ...
result:
wrong answer 1st numbers differ - expected: '6', found: '5'