Submission #1249225

#TimeUsernameProblemLanguageResultExecution timeMemory
1249225yoshi_33550336Genetics (BOI18_genetics)C++20
46 / 100
2095 ms67352 KiB
#include <bits/stdc++.h>
using namespace std;
#ifndef yoshi_likes_e4
#define endl '\n'
#endif
#define problem ""
#define multitest 0
#define debug(x) cerr << #x << " = " << x << endl;
void init()
{
}
string A[4100];
bitset<4100> Ab[4][4100];
int C[256];
int cnt[4101];
int diff[4100][4100];
void Yoshi()
{
    C['A'] = 0;
    C['T'] = 1;
    C['C'] = 2;
    C['G'] = 3;
    int n, m, k;
    cin >> n >> m >> k;
    for (int i = 0; i < n; i++)
        cin >> A[i];
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            Ab[C[A[i][j]]][i][j] = 1;
    for (int i = 0; i < n; i++)
        for (int j = i + 1; j < n; j++)
            diff[j][i] = diff[i][j] =
                m -
                ((Ab[0][j] & Ab[0][i]) | (Ab[1][j] & Ab[1][i]) | (Ab[2][j] & Ab[2][i]) | (Ab[3][j] & Ab[3][i])).count();
    for (int i = 0; i < n; i++)
    {
        bool ck = 1;
        for (int j = 0; j < n; j++)
        {
            if (diff[i][j] != k && i != j)
            {
                ck = 0;
                break;
            }
        }
        if (ck)
            cout << i + 1 << endl, exit(0);
    }
}

signed main()
{
#ifndef yoshi_likes_e4
    ios::sync_with_stdio(0);
    if (fopen(problem ".inp", "r"))
    {
        freopen(problem ".inp", "r", stdin);
        freopen(problem ".out", "w", stdout);
    }
#endif
    init();
    int t = 1;
#if multitest
    fin >> t;
#endif
    while (t--)
        Yoshi();
}

Compilation message (stderr)

genetics.cpp: In function 'int main()':
genetics.cpp:57:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   57 |         freopen(problem ".inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
genetics.cpp:58:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   58 |         freopen(problem ".out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...