LeetCode Weekly Contest 369
問題文
省略
省略
C++に変換後のコードはこちら
#define main dummy_main
{}
#undef main
class Solution {
public:
int findKOr(VI &A, int K) {
int res = 0, c[31] = {}, N = A.size();
for(int x : A) rep(j,31) if(BIT_ith(x,j)) c[j]++;
rep(j,31) if(c[j] >= K) res |= BIT_ith(j);
return res;
}
};
Current time: 2024年05月06日00時42分35秒
Last modified: 2023年10月31日21時48分48秒 (by laycrs)
Tags: Competitive_Programming_Incomplete LeetCode
トップページに戻る
Logged in as: unknown user (not login)