Submission #575283

# Submission time Handle Problem Language Result Execution time Memory
575283 2022-06-10T05:47:17 Z AGE Sajam (COCI18_sajam) C++14
45 / 90
1394 ms 33864 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){

            cout<<"DA"<<endl;
            return 0;

        }
    }

    cout<<"NE"<<endl;
}
///use scanf

Compilation message

sajam.cpp:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main()
      | ^~~~
# Verdict Execution time Memory Grader output
1 Correct 15 ms 31572 KB Output is correct
2 Correct 19 ms 31880 KB Output is correct
3 Correct 22 ms 32340 KB Output is correct
4 Correct 36 ms 32848 KB Output is correct
5 Correct 20 ms 32336 KB Output is correct
6 Correct 17 ms 31816 KB Output is correct
7 Correct 193 ms 32304 KB Output is correct
8 Correct 1136 ms 32864 KB Output is correct
9 Correct 32 ms 31672 KB Output is correct
10 Correct 1185 ms 32876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 16 ms 31572 KB Output is correct
2 Correct 16 ms 31620 KB Output is correct
3 Incorrect 17 ms 31572 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 28 ms 32684 KB Output is correct
2 Correct 31 ms 32716 KB Output is correct
3 Correct 26 ms 32580 KB Output is correct
4 Correct 24 ms 32596 KB Output is correct
5 Correct 32 ms 32768 KB Output is correct
6 Correct 243 ms 32400 KB Output is correct
7 Correct 600 ms 32688 KB Output is correct
8 Correct 666 ms 32724 KB Output is correct
9 Correct 112 ms 31956 KB Output is correct
10 Correct 1394 ms 33848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 32716 KB Output is correct
2 Correct 30 ms 32784 KB Output is correct
3 Correct 24 ms 32596 KB Output is correct
4 Correct 26 ms 32596 KB Output is correct
5 Correct 29 ms 32596 KB Output is correct
6 Correct 1286 ms 33864 KB Output is correct
7 Correct 169 ms 31956 KB Output is correct
8 Correct 547 ms 32660 KB Output is correct
9 Correct 633 ms 32716 KB Output is correct
10 Correct 1391 ms 33848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 32596 KB Output is correct
2 Correct 25 ms 32544 KB Output is correct
3 Incorrect 1357 ms 33828 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 37 ms 33752 KB Output is correct
2 Correct 37 ms 33740 KB Output is correct
3 Incorrect 1154 ms 32868 KB Output isn't correct
4 Halted 0 ms 0 KB -