| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 594068 | Zanite | Genetics (BOI18_genetics) | C++17 | 2017 ms | 5916 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// I am now here, but I have yet to prove that I am worthy of my place here.
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using si = short int;
const si maxN = 4101;
si N, M, K;
bitset<maxN> DNA[4][maxN];
bitset<maxN> tmp;
char corr[256];
char buf;
int main() {
corr[(int)'A'] = 0;
corr[(int)'C'] = 1;
corr[(int)'G'] = 2;
corr[(int)'T'] = 3;
scanf("%hi %hi %hi", &N, &M, &K);
K <<= 1;
for (si i = 1; i <= N; i++) {
for (si j = 0; j < M; j++) {
scanf(" %c", &buf);
DNA[corr[buf]][i][j] = 1;
}
}
vector<si> order(N);
iota(order.begin(), order.end(), 1);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
shuffle(order.begin(), order.end(), rng);
for (si comp = 0; comp < N; comp++) {
si C = order[comp];
bool valid = 1;
for (si other = 0; other < N; other++) {
si O = order[other];
if (C == O) continue;
int d = 0;
for (int i = 0; i < 4; i++) {
d += (DNA[i][C] ^ DNA[i][O]).count();
}
if (d != K) {
valid = 0;
break;
}
}
if (valid) {
printf("%d\n", C);
return 0;
}
}
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
