| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 438870 | amalla | DNA 돌연변이 (IOI21_dna) | C++17 | 111 ms | 31208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> VI;
const int maxN = 100'000;
vector<VI> A(maxN+4, VI(3)), B(maxN+4, VI(3)), AW(maxN+4, VI(2)), TW(maxN+4, VI(2)), CW(maxN+4, VI(2));
void init(string a, string b) {
for (int i = 1; i<=a.size(); ++i) {
A[i] = A[i-1], B[i] = B[i-1], AW[i] = AW[i-1], TW[i] = TW[i-1], CW[i] = CW[i-1];
if (a[i-1]=='A') {
++A[i][0];
if (b[i-1]=='T') ++TW[i][0];
else if (b[i-1]=='C') ++CW[i][0];
}
else if (a[i-1]=='T') {
++A[i][1];
if (b[i-1]=='A') ++AW[i][0];
else if (b[i-1]=='C') ++CW[i][1];
}
else {
++A[i][2];
if (b[i-1]=='A') ++AW[i][1];
else if (b[i-1]=='T') +TW[i][1];
}
if (b[i-1]=='A') ++B[i][0];
else if (b[i-1]=='T') ++B[i][1];
else ++B[i][2];
}
}
int get_distance(int x, int y) {
if ( (A[y+1][0] - A[x][0] == B[y+1][0] - B[x][0]) && (A[y+1][1] - A[x][1] == B[y+1][1] - B[x][1]) && (A[y+1][2] - A[x][2] == B[y+1][2] - B[x][2]) ) {
return min(AW[y+1][0] - AW[x][0], TW[y+1][0]-TW[x][0]) + min(AW[y+1][1] - AW[x][1], CW[y+1][0]-CW[x][0]) +
min(CW[y+1][1] - CW[x][1], TW[y+1][1]-TW[x][1]) + abs((CW[y+1][1] - CW[x][1]) - (TW[y+1][1]-TW[x][1]))*2;
}
return -1;
}컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
