#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
7 ms |
768 KB |
Output is correct |
3 |
Correct |
8 ms |
896 KB |
Output is correct |
4 |
Correct |
17 ms |
1280 KB |
Output is correct |
5 |
Correct |
8 ms |
896 KB |
Output is correct |
6 |
Correct |
6 ms |
640 KB |
Output is correct |
7 |
Correct |
709 ms |
896 KB |
Output is correct |
8 |
Correct |
4624 ms |
1308 KB |
Output is correct |
9 |
Correct |
71 ms |
512 KB |
Output is correct |
10 |
Correct |
4705 ms |
1376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Incorrect |
6 ms |
384 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
1024 KB |
Output is correct |
2 |
Correct |
14 ms |
1152 KB |
Output is correct |
3 |
Correct |
11 ms |
1024 KB |
Output is correct |
4 |
Correct |
10 ms |
1024 KB |
Output is correct |
5 |
Correct |
15 ms |
1280 KB |
Output is correct |
6 |
Correct |
126 ms |
896 KB |
Output is correct |
7 |
Correct |
297 ms |
1144 KB |
Output is correct |
8 |
Correct |
359 ms |
1272 KB |
Output is correct |
9 |
Correct |
376 ms |
888 KB |
Output is correct |
10 |
Execution timed out |
5084 ms |
1280 KB |
Time limit exceeded |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
1152 KB |
Output is correct |
2 |
Correct |
14 ms |
1152 KB |
Output is correct |
3 |
Correct |
11 ms |
1024 KB |
Output is correct |
4 |
Correct |
12 ms |
1024 KB |
Output is correct |
5 |
Correct |
13 ms |
1024 KB |
Output is correct |
6 |
Correct |
683 ms |
1280 KB |
Output is correct |
7 |
Correct |
94 ms |
768 KB |
Output is correct |
8 |
Correct |
275 ms |
1024 KB |
Output is correct |
9 |
Correct |
2470 ms |
1172 KB |
Output is correct |
10 |
Execution timed out |
5032 ms |
1280 KB |
Time limit exceeded |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
1024 KB |
Output is correct |
2 |
Correct |
11 ms |
1024 KB |
Output is correct |
3 |
Incorrect |
731 ms |
1280 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
1408 KB |
Output is correct |
2 |
Correct |
17 ms |
1280 KB |
Output is correct |
3 |
Incorrect |
617 ms |
1280 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |