# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
575276 | AGE | Sajam (COCI18_sajam) | C++14 | 1041 ms | 34464 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>
#define int long long
#define F first
#define S second
#define pb push_back
using namespace std;
const int N=1e6,M=3e3+2,mod=1e9+7;
string s[N];
main()
{
int n,m;
cin>>n>>m;
for(int i=0;i<n;i++)
cin>>s[i];
for(int i=0;i<n;i++){
int ans=0;
for(int j=0;j<n;j++){
if(i==j)
continue;
int cnt=0;
for(int k=0;k<n;k++)
cnt+=(s[i][k]!=s[j][k]);
int cnt2=0;
for(int k=0;k<n;k++)
cnt2+=(s[i][k]==s[j][k]);
ans+=min(cnt,cnt2);
if(ans>m)
break;
}
if(ans<=m){
cout<<"DA"<<endl;
return 0;
}
}
cout<<"NE"<<endl;
}
///use scanf
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... |