제출 #230483

#제출 시각아이디문제언어결과실행 시간메모리
230483VEGAnnSajam (COCI18_sajam)C++14
15 / 90
5084 ms1408 KiB
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define pii pair<int,int>
#define pis pair<int,short>
#define ft first
#define sd second
#define MP make_pair
#define PB push_back
#define all(x) x.begin(),x.end()
using namespace std;
typedef long long ll;
const int oo = 2e9;
const int N = 1010;
int n, kk, m;
char c[N][N];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

#ifdef _LOCAL
    freopen("in.txt","r",stdin);
#endif // _LOCAL

    cin >> n >> kk;

    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            cin >> c[i][j];

    for (int id = 0; id < n; id++){
        int k = kk;

        for (int i = 0; i < n; i++){
            int k0 = 0, k1 = 0;

            for (int j = 0; j < n; j++)
                if (c[id][j] == c[i][j])
                    k0++;
                else k1++;

            k -= min(k0, k1);
        }

        if (k >= 0){
            cout << "DA";
            return 0;
        }
    }

    cout << "NE";

    return 0;
}
#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...