제출 #1096053

#제출 시각아이디문제언어결과실행 시간메모리
1096053andrewpGenetics (BOI18_genetics)C++14
27 / 100
2 ms1116 KiB
//Dedicated to my love, ivaziva #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int, int>; using ll = int64_t; #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define dbg(x) cerr<<#x<<": "<<x<<'\n'; #define dbga(A,l_,r_){for(int i_=l_;i_<=r_;i_++)cerr<<A[i_]<<' ';cerr<<'\n';} #define dbgv(a_){for(auto x_:a_) cerr<<x_<<' ';cerr<<'\n';} const int maxn = 105; int n, m, k; string a[maxn]; int32_t main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cerr.tie(nullptr); cin >> n >> m >> k; for (int i = 1; i <= n; i++) { cin >> a[i]; } int ans = 0; for (int i = 1; i <= n; i++) { bool ok = true; for (int j = 1; j <= n; j++) { if (i == j) { continue; } int cnt = 0; for (int p = 0; p < m; p++) { if (a[i][p] != a[j][p]) { cnt++; } } if (cnt != k) { ok = false; } } if (ok) { ans = i; } } assert(ans != 0); cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...