# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
228395 | kimbj0709 | Ispit (COCI19_ispit) | C++14 | 189 ms | 2760 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define maxn 505
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int no_of_input;
int arr[maxn][maxn];
int kk;
cin >> no_of_input >> kk;
vector<int> can(maxn,0);
char input;
for(int i=0;i<no_of_input;i++){
for(int j=0;j<no_of_input;j++){
cin >> input;
arr[i][j] = input;
}
}
for(int i=0;i<no_of_input;i++){
for(int j=i+1;j<no_of_input;j++){
int cnt = 0,mini = INT_MAX,maxi = INT_MIN;
for(int k=0;k<no_of_input;k++){
if(arr[i][k]!=arr[j][k]){
cnt++;
mini = min(mini,k);
maxi = max(maxi,k);
}
}
vector<int> temp(27,0);
vector<int> temp2(27,0);
if(mini==INT_MAX&&maxi==INT_MIN){
cout << "DA";
return 0;
}
if(maxi-mini+1<=kk){
for(int a=mini;a<=maxi;a++){
temp[arr[i][a]-'a']++;
temp2[arr[j][a]-'a']++;
}
for(int a=0;a<temp.size();a++){
if(temp[a]!=temp2[a]){
goto cont;
}
}
cout << "DA";
return 0;
cont : ;
}
}
}
cout << "NE";
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |