QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#163375 | #7112. XOR Clique | awesomenick1303# | WA | 11ms | 3568kb | C++20 | 742b | 2023-09-04 02:10:27 | 2023-09-04 02:10:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define F first
#define S second
#define nl "\n"
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int,int> pii;
void solve() {
int n;
cin >> n;
vi a(n);
rep(i, 0, n) cin >> a[i];
sort(all(a));
int l = 0, r = 0;
int ans = 0;
for(int d = 1; d < 30; d++) {
while(r < n && a[r] < (1<<d)) r++;
ans = max(ans, r-l);
l = r;
}
cout << ans << nl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--) {
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3420kb
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: 0
Accepted
time: 6ms
memory: 3424kb
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:
6 5 6 7 6 6 3 8 6 6 4 7 6 3 4 4 4 5 3 6 4 5 4 5 5 4 3 6 6 6 4 8 5 4 5 5 6 6 4 4 4 5 4 5 5 3 5 7 5 5 4 4 5 6 6 5 7 4 4 4 4 5 4 3 6 4 4 3 4 6 3 6 4 4 4 5 5 5 4 4 6 5 4 7 4 5 4 4 4 5 4 4 4 6 5 5 5 5 5 4 7 5 4 6 5 4 4 4 4 5 4 5 6 8 4 5 4 5 9 5 4 3 4 5 5 4 5 4 4 3 5 5 4 5 5 4 5 4 5 5 4 4 3 3 4 4 5 4 8 5 ...
result:
ok 10000 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
1000 100 31 41 94 23 98 34 23 99 68 31 98 43 28 90 19 43 97 36 35 11 63 47 70 57 46 29 74 99 83 83 42 28 66 58 24 18 93 54 3 46 39 86 98 84 58 85 75 46 50 64 5 58 67 29 18 5 63 94 74 85 70 12 6 4 44 9 90 58 23 46 39 79 70 97 97 18 75 84 51 43 77 73 98 54 47 52 86 94 76 16 45 75 44 14 81 53 49 12 58 ...
output:
40 36 38 35 39 36 38 42 38 40 40 37 36 43 42 37 44 35 45 38 42 33 39 42 36 36 46 37 32 46 44 34 41 33 35 37 39 37 32 40 37 43 40 33 45 36 41 31 39 40 36 35 35 39 31 52 36 36 41 35 38 41 34 35 38 37 36 38 35 37 39 40 40 40 34 35 44 43 35 40 34 41 36 32 38 37 38 36 40 37 37 36 35 34 38 37 45 38 39 38 ...
result:
ok 1000 numbers
Test #4:
score: 0
Accepted
time: 8ms
memory: 3432kb
input:
100 1000 903 492 790 186 953 974 661 801 790 194 464 866 442 969 548 824 611 799 83 872 85 667 353 172 526 947 368 291 474 446 437 111 808 16 329 845 714 577 904 873 65 638 181 471 600 831 996 435 572 95 695 826 74 160 778 423 89 420 967 719 331 949 347 613 793 197 135 951 876 719 952 62 309 893 551...
output:
509 488 475 510 534 486 487 486 511 498 478 490 451 493 497 493 487 498 483 503 483 507 509 491 485 461 479 478 493 503 514 477 493 499 500 481 500 469 482 472 479 488 474 503 488 500 481 509 491 479 496 522 495 502 484 515 486 484 469 497 499 486 512 491 508 474 495 487 493 512 468 491 490 482 480 ...
result:
ok 100 numbers
Test #5:
score: 0
Accepted
time: 10ms
memory: 3568kb
input:
10 10000 5285 2073 7309 54 2183 1460 5877 9121 9200 3992 1728 5442 1118 4300 8567 9658 9618 9531 1652 286 9506 3396 8311 2198 263 7561 2148 447 9632 3936 2723 6938 9566 5333 8399 8763 3126 7110 8088 7514 4306 149 2385 4853 4064 90 2626 7324 8465 4959 2199 7396 2123 5634 607 8165 936 7766 5326 7404 2...
output:
4150 4007 4027 4128 4119 4109 4207 3964 4147 4052
result:
ok 10 numbers
Test #6:
score: -100
Wrong Answer
time: 11ms
memory: 3416kb
input:
10000 10 280451563 345810854 770436752 598622543 887124330 25405486 761170404 304973882 88233746 926776090 10 501279697 561221354 616450860 372349246 194446593 700711526 166921955 468736755 182963522 647567226 10 264111817 899530903 149825543 471443764 375924049 397433611 226749669 978130792 2267380...
output:
3 3 4 2 5 3 3 2 4 2 3 3 2 3 4 3 3 1 4 4 2 2 3 2 4 3 5 2 2 4 2 2 2 3 2 3 2 4 2 3 4 2 2 4 1 3 2 4 2 5 3 1 5 4 3 6 4 2 4 3 3 3 3 2 2 4 4 3 2 3 4 2 4 3 3 4 2 2 5 4 3 4 4 5 2 1 4 3 4 3 1 3 3 2 2 3 3 2 2 4 4 3 4 3 3 4 3 2 3 2 2 2 3 2 3 1 3 2 3 2 2 4 3 3 1 5 3 3 3 3 2 3 5 4 2 2 4 2 4 4 3 2 4 2 2 2 3 1 3 2 ...
result:
wrong answer 1st numbers differ - expected: '5', found: '3'