제출 #170330

#제출 시각아이디문제언어결과실행 시간메모리
170330ngmhIspit (COCI19_ispit)C++11
90 / 90
132 ms1400 KiB
#include <bits/stdc++.h> using namespace std; int n, k, s, e; string a[505], b[505]; int main(){ cin >> n >> k; for(int i = 0; i < n; i++){ cin >> a[i]; b[i] = a[i]; sort(b[i].begin(), b[i].end()); } for(int i = 0; i < n; i++){ for(int j = 0; j < i; j++){ if(b[i] != b[j]) continue; s = n; e = 0; for(int l = 0; l < n; l++){ if(a[i][l] != a[j][l]){ s = min(s, l); e = max(e, l); } } if((e-s+1) <= k){ cout << "DA"; return 0; } } } cout << "NE"; }
#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...