Submission #575276

# Submission time Handle Problem Language Result Execution time Memory
575276 2022-06-10T05:32:09 Z AGE Sajam (COCI18_sajam) C++14
45 / 90
1041 ms 34464 KB
#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

sajam.cpp:10:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   10 | main()
      | ^~~~
# Verdict Execution time Memory Grader output
1 Correct 16 ms 31608 KB Output is correct
2 Correct 19 ms 31968 KB Output is correct
3 Correct 22 ms 32316 KB Output is correct
4 Correct 34 ms 33164 KB Output is correct
5 Correct 22 ms 32276 KB Output is correct
6 Correct 18 ms 31752 KB Output is correct
7 Correct 20 ms 32340 KB Output is correct
8 Correct 35 ms 33228 KB Output is correct
9 Correct 17 ms 31700 KB Output is correct
10 Correct 40 ms 33292 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 31540 KB Output is correct
2 Correct 16 ms 31620 KB Output is correct
3 Incorrect 16 ms 31572 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 28 ms 32780 KB Output is correct
2 Correct 30 ms 33016 KB Output is correct
3 Correct 24 ms 32676 KB Output is correct
4 Correct 25 ms 32600 KB Output is correct
5 Correct 32 ms 33148 KB Output is correct
6 Correct 206 ms 32460 KB Output is correct
7 Correct 507 ms 32840 KB Output is correct
8 Correct 576 ms 32928 KB Output is correct
9 Correct 18 ms 31956 KB Output is correct
10 Correct 38 ms 34348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 34 ms 33084 KB Output is correct
2 Correct 33 ms 33036 KB Output is correct
3 Correct 25 ms 32592 KB Output is correct
4 Correct 28 ms 32788 KB Output is correct
5 Correct 27 ms 32868 KB Output is correct
6 Correct 1041 ms 34352 KB Output is correct
7 Correct 136 ms 31956 KB Output is correct
8 Correct 488 ms 32788 KB Output is correct
9 Correct 28 ms 32760 KB Output is correct
10 Correct 37 ms 34412 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 32512 KB Output is correct
2 Correct 25 ms 32636 KB Output is correct
3 Incorrect 709 ms 34412 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 44 ms 34464 KB Output is correct
2 Correct 38 ms 34380 KB Output is correct
3 Incorrect 599 ms 33336 KB Output isn't correct
4 Halted 0 ms 0 KB -