QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#242795 | #7112. XOR Clique | xuxubaobao | WA | 6ms | 3708kb | C++17 | 691b | 2023-11-07 17:17:02 | 2023-11-07 17:17:02 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using PII = pair<int,int>;
using ll = long long;
constexpr int N = 2e6 + 10;
int w[N];
int c[100];
void solve() {
int n;
cin >> n;
memset(c, 0, sizeof c);
for(int i = 1; i <= n; i ++) {
cin >> w[i];
}
for(int i = 1; i <= n; i ++) {
for(int j = 60; j >= 0; j --) {
if(w[i] >> j & 1) {
c[j] ++;
break;
}
}
}
int mx = 0;
for(int i = 0; i <= 60; i ++) {
mx = max(mx, c[i]);
}
cout << mx << "\n";
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
t = 1;
cin >> t;
while(t --){
solve();
}
}
/*
3
3
1 2 3
3
1 1 1
5
1 2323 534 534 5
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
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: 3616kb
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: 5ms
memory: 3708kb
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: 5ms
memory: 3632kb
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: 5ms
memory: 3680kb
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: 2ms
memory: 3632kb
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:
4 6 6 5 7 4 3 4 6 4 4 4 4 5 6 6 6 3 5 5 6 5 5 5 7 4 5 5 5 4 5 3 5 4 5 6 4 6 4 4 7 5 4 5 5 5 5 4 4 8 6 4 4 8 4 4 6 3 7 3 7 6 3 3 3 7 5 6 5 4 4 5 6 4 7 4 5 4 6 7 6 6 3 4 4 3 6 5 6 7 6 6 4 5 7 5 3 3 5 8 4 7 5 3 6 6 5 4 4 5 4 6 5 5 6 3 5 4 5 8 5 8 5 5 5 5 5 5 5 4 5 4 4 4 4 3 5 4 4 8 4 4 7 5 3 6 5 3 6 4 ...
result:
wrong answer 1st numbers differ - expected: '5', found: '4'