Submission #575283

#TimeUsernameProblemLanguageResultExecution timeMemory
575283AGESajam (COCI18_sajam)C++14
45 / 90
1394 ms33864 KiB
#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){ cout<<"DA"<<endl; return 0; } } cout<<"NE"<<endl; } ///use scanf

Compilation message (stderr)

sajam.cpp:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main()
      | ^~~~
#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...