| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 871291 | LucaLucaM | DNA 돌연변이 (IOI21_dna) | C++17 | 1533 ms | 3924 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dna.h"
#include <iostream>
std::string s, q;
int n;
void init(std::string a, std::string b) {
n = (int) a.size();
for (auto &ch : a) {
if (ch == 'A') {
ch = 0;
} else if (ch == 'C') {
ch = 1;
} else {
ch = 2;
}
}
for (auto &ch : b) {
if (ch == 'A') {
ch = 0;
} else if (ch == 'C') {
ch = 1;
} else {
ch = 2;
}
}
s = '$' + a, q = '$' + b;
}
int get_distance(int x, int y) {
++x, ++y;
int bad = 0;
int d[3] = {};
for (int i = x; i <= y; i++) {
if (s[i] != q[i]) {
bad++;
}
d[s[i]]++;
d[q[i]]--;
}
if (d[0] != 0 || d[1] != 0 || d[2] != 0) {
return -1;
}
return (bad + 1) / 2;
}
/**
6 3
ATACAT
ACTATA
1 3
4 5
3 5
123
231
**/
컴파일 시 표준 에러 (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... | ||||
