#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);cin.tie(0);
int n, k; cin >> n >> k;
char arr[n][n];
for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) cin >> arr[i][j];
char tmp[n][n];
for(int i = k - 1; i < n; i++){
for(int j = 0; j < n; j++) for(int l = 0; l < n; l++) tmp[j][l] = arr[j][l];
for(int j = 0; j < n; j++) sort(tmp[j] + i - k + 1, tmp[j] + i + 1);
multiset<string> st;
for(int j = 0; j < n; j++){
string s = "";
for(int l = 0; l < n; l++) s += tmp[j][l];
if(st.find(s) != st.end()) {cout << "DA\n"; return 0;}
st.insert(s);
}
}
cout << "NE\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
328 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
324 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
468 KB |
Output is correct |
2 |
Correct |
12 ms |
468 KB |
Output is correct |
3 |
Correct |
53 ms |
468 KB |
Output is correct |
4 |
Correct |
52 ms |
476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
468 KB |
Output is correct |
2 |
Correct |
6 ms |
500 KB |
Output is correct |
3 |
Correct |
59 ms |
476 KB |
Output is correct |
4 |
Correct |
6 ms |
400 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
596 KB |
Output is correct |
2 |
Correct |
4 ms |
468 KB |
Output is correct |
3 |
Correct |
39 ms |
464 KB |
Output is correct |
4 |
Correct |
6 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
400 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
62 ms |
468 KB |
Output is correct |
4 |
Correct |
25 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
51 ms |
1236 KB |
Output is correct |
2 |
Correct |
62 ms |
1332 KB |
Output is correct |
3 |
Correct |
288 ms |
1336 KB |
Output is correct |
4 |
Correct |
66 ms |
1332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
51 ms |
1324 KB |
Output is correct |
2 |
Correct |
8 ms |
1108 KB |
Output is correct |
3 |
Correct |
769 ms |
1332 KB |
Output is correct |
4 |
Correct |
164 ms |
1336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
35 ms |
1348 KB |
Output is correct |
2 |
Correct |
82 ms |
1332 KB |
Output is correct |
3 |
Correct |
787 ms |
1328 KB |
Output is correct |
4 |
Correct |
70 ms |
1312 KB |
Output is correct |