제출 #512497

#제출 시각아이디문제언어결과실행 시간메모리
512497wildturtleSajam (COCI18_sajam)C++14
45 / 90
306 ms3276 KiB
#include<bits/stdc++.h>
#define ll long long
#define f first
#define sc second
#define pb push_back
using namespace std;
ll a,b,c,d,i,e,f,g,n,m,k,l,minn;
bitset<1000> A[1000];
string s[1003];
ll xorr(bitset<1000> x, bitset<1000> y){return min((ll)(x^y).count(), (ll)(n-(x^y).count()));}
ll go(ll x) {
    ll cur=0;
    for(ll i=1;i<=n;i++) {
        if(i==x) continue;
        cur+=xorr(A[i],A[x]);
    }
    return cur;
}
int main() {
    cin>>n>>k;
    for(ll i=1;i<=n;i++) {
        cin>>s[i];
        for(ll j=0;j<s[i].size();j++) {
            A[i][j]=(s[i][j]=='x');
        }
    }
    minn=1e18;
    for(ll i=1;i<=n;i++) {
        minn=min(minn,go(i));
    }
    if(n==k) {
        for(ll j=0;j<n;j++) {
            if(A[i][j]==0) A[i][j]=1;
            else A[i][j]=0;
            minn=min(minn,go(i)+1);
            if(A[i][j]==0) A[i][j]=1;
            else A[i][j]=0;
        }
    }
    if(minn<=k) cout<<"DA";
    else cout<<"NE";
}

컴파일 시 표준 에러 (stderr) 메시지

sajam.cpp: In function 'int main()':
sajam.cpp:23:21: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         for(ll j=0;j<s[i].size();j++) {
      |                    ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...