QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#156258 | #7112. XOR Clique | ucup-team1087# | WA | 10ms | 6024kb | C++14 | 1.3kb | 2023-09-02 13:22:36 | 2023-09-02 14:47:29 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,a,n) for(int i=n;i>=a;i--)
#define fi first
#define se second
#define pb push_back
#define mem(a,x) memset(a,x,sizeof(a))
#define all(x) x.begin(),x.end()
#define lisan(x) {sort(all(x));x.erase(unique(all(x)),x.end());}
#define SZ(x) ((int)((x).size()))
#define debug(x) cout<<#x<<"="<<x<<"\n";
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<vector<int>> VII;
typedef vector<ll> VL;
typedef vector<vector<ll>> VLL;
typedef unsigned long long ull;
typedef double db;
template<typename T> inline void cmax(T &a,const T b){if(a<b) a=b;}
template<typename T> inline void cmin(T &a,const T b){if(a>b) a=b;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T> inline T lcm(T a,T b){return a/gcd(a,b)*b;}
constexpr int N=1e6+10;
constexpr int mod=1e9+7;
//constexpr int mod=998244353;
int n,a[N],v[N],num[31],ans;
inline void solve(){
scanf("%d",&n);
rep(i,1,n) scanf("%d",&a[i]),v[i]=false;
ans=0;
rep(i,0,30) num[i]=0;
per(i,0,30){
rep(j,1,n)
if(!v[j]&&(1ll<<i&a[j])){
v[i]=true;
num[i]++;
}
}
rep(i,0,30) cmax(ans,num[i]);
printf("%d\n",ans);
}
int main(){
int T=1;
scanf("%d",&T);
while(T--) solve();
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 6024kb
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: 10ms
memory: 6020kb
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 7 5 6 5 5 5 6 6 6 5 6 6 4 5 5 4 4 6 6 4 5 5 5 6 5 5 5 5 5 5 7 4 5 6 7 6 6 5 7 4 5 5 5 5 5 6 6 5 6 5 5 5 5 6 4 6 5 4 4 7 4 4 5 5 5 6 3 4 5 6 8 4 4 4 6 4 5 4 4 6 5 7 6 4 5 7 6 4 8 4 4 5 6 4 5 4 5 5 4 6 6 5 5 5 3 4 4 6 4 5 5 5 7 4 5 5 6 9 7 4 5 4 4 5 6 5 6 5 4 5 5 5 5 4 6 4 7 5 5 4 5 3 4 5 5 6 6 6 6 ...
result:
wrong answer 1st numbers differ - expected: '6', found: '5'