제출 #1274611

#제출 시각아이디문제언어결과실행 시간메모리
1274611DanielPr8Genetics (BOI18_genetics)C++20
19 / 100
2094 ms2524 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using pll = pair<ll,ll>;
using vpl = vector<pll>;
using vvl =vector<vll>;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(),v.end()

int main(){
    ios_base::sync_with_stdio(0);cin.tie(NULL);
    ll n, m, k;
    cin >> n >> m >> k;
    vector<bitset<4100>> lw(n);
    for(ll i = 0; i < n; ++i){
        for(ll j = 0; j < m; ++j){
            char c;
            cin >> c;
            if(c=='C')lw[i][j]=1;
        }
    }
    vll ord(n);
    iota(all(ord),0);
    random_device g;
    shuffle(all(ord), g);
    for(ll i: ord){
        ll o=0;
        for(ll j: ord){
            if(j==i)continue;
            lw[i]^=lw[j];
            if(lw[i].count()!=k){
                lw[i]^=lw[j];
                o=1;
                break;
            }
            lw[i]^=lw[j];
        }
        if(!o){cout << i+1;break;}
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...