제출 #1239486

#제출 시각아이디문제언어결과실행 시간메모리
1239486wenbangGenetics (BOI18_genetics)C++20
0 / 100
14 ms3140 KiB
#include <iostream>
#include <vector>

#ifdef LOCAL
#include "print.h"
#else
template <typename... Args> inline void print(const Args&... args) {}
inline void                             newline() {}
#endif

using ll = long long;
#define endl      '\n'
#define FOR(i, n) for (int i = 0; i < n; i++)

using namespace std;

struct Position {
    int A, C, G, T;
};

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif

    int n, m, k;
    cin >> n >> m >> k;
    vector<string>   clones(n);
    vector<Position> positions(m);
    FOR(i, n) {
        cin >> clones [i];
        FOR(j, m) {
            if (clones [i][j] == 'A') {
                positions [j].A++;
            }
            else if (clones [i][j] == 'C') {
                positions [j].C++;
            }
            else if (clones [i][j] == 'G') {
                positions [j].G++;
            }
            else if (clones [i][j] == 'T') {
                positions [j].T++;
            }
        }
    }
    FOR(i, n) {
        int count = 0;
        FOR(j, m) {
            if (clones [i][j] == 'A') {
                count += positions [j].A;
            }
            else if (clones [i][j] == 'C') {
                count += positions [j].C;
            }
            else if (clones [i][j] == 'G') {
                count += positions [j].G;
            }
            else if (clones [i][j] == 'T') {
                count += positions [j].T;
            }
            count--;
        }
        if (count == (n - 1) * (m - k)) {
            cout << i + 1 << endl;
            break;
        }
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...