Codeforces Deltix Round, Spring 2021 D問題 - Love-Hate

Source

Codeforces Deltix Round, Spring 2021 D問題 (2250pt)
Problem description

問題概要

省略

解法

省略

cLayversion 20210607-1)のコード

C++に変換後のコードはこちら

//no-unlocked
int N, M, P;
char S[2d5][62];
int sz, ok[60];
int cnt[1d6];
int opt = -1; char res[62];
{
  int i, j, k, c, nd;
  Rand rnd;
  rep(100) rnd.get();

  rd(N,M,P,S(N));
  rep(i,N) rep(j,M) S[i][j] -= '0';
  nd = N /+ 2;

  rep(20){
    i = rnd.get(N);
    sz = 0;
    rep(k,M) if(S[i][k]) ok[sz++] = k;
    rep(mask,1<<sz) cnt[mask] = 0;
    rep(i,N){
      k = 0;
      rep(j,sz) if(!S[i][ok[j]]) k |= (1<<j);
      cnt[k]++;
    }
    ZetaTransform(1<<sz, cnt);
    rep(mask,1<<sz) if(cnt[mask] >= nd){
      c = sz - BIT_popcount(mask);
      if(c <= opt) continue;
      opt = c;
      rep(i,M) res[i] = '0';
      rep(i,sz) if(!BIT_ith(mask,i)) res[ok[i]] = '1';
    }
  }
  wt(res);
}

Current time: 2024年04月20日01時03分53秒
Last modified: 2021年06月07日19時36分17秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る

Logged in as: unknown user (not login)

ログイン: