제출 #164231

#제출 시각아이디문제언어결과실행 시간메모리
164231rajarshi_basuIspit (COCI19_ispit)C++14
0 / 90
8 ms632 KiB
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<n;i++) #define FORE(i,a,b) for(int i = a;i<=b;i++) #define ll long long int #define pb push_back #define vi vector<int> #define ff first #define ss second #define vv vector #define ii pair<int,int> using namespace std; const int MAXN = 501; char grid[MAXN][MAXN]; int compo[MAXN][26]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n,k; cin >> n >> k; FOR(i,n){ string s;cin >> s; FOR(j,n)grid[i][j] = s[j],compo[i][s[j]-'a']++; } bool ok = 0; FOR(i,n){ FOR(j,n){ if(i > j)continue; bool b = 1; FOR(a,26){ if(compo[i][a] != compo[j][a])b = 0; } if(!b)continue; int ctr = 0; FOR(a,n)ctr += grid[i][a] != grid[j][a]; if(ctr <= k)ok = 1; } } if(ok)cout << "DA" << endl; else cout << "NE" << endl; 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...