제출 #164234

#제출 시각아이디문제언어결과실행 시간메모리
164234rajarshi_basuIspit (COCI19_ispit)C++14
90 / 90
10 ms632 KiB
#include <iostream> #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)if(grid[i][a] != grid[j][a])break;else ctr++; FOR(a,n)if(grid[i][n-a-1] != grid[j][n-a-1])break; else ctr++; //cout << i << " " << j << endl; if(n-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...