| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 633216 | resting | DNA 돌연변이 (IOI21_dna) | C++17 | 47 ms | 7416 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dna.h"
#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5+5;
int ps[mx][3][3] {};
void init(std::string a, std::string b) {
map<char, int> m = {{'A', 0}, {'C', 1}, {'T', 2}};
for(int i = 0; i < size(a); i++){
ps[i][m[a[i]]][m[b[i]]]++;
}
for(int i = 1; i < size(a); i++){
for(int a = 0; a < 3; a++){
for(int b = 0; b < 3; b++){
ps[i][a][b] += ps[i-1][a][b];
}
}
}
}
int get_distance(int x, int y) {
int z[3][3];
for(int a = 0; a < 3; a++)
for(int b = 0; b < 3; b++)
z[a][b] = ps[y][a][b];
if(x){
for(int a = 0; a < 3; a++)
for(int b = 0; b < 3; b++)
z[a][b] -= ps[x-1][a][b];
}
int res = 0;
for(int a = 0; a < 2; a++){
for(int b = a+1; b < 3; b++){
int t = min(z[a][b], z[b][a]);
res += t;
z[a][b] -= t;
z[b][a] -= t;
}
}
if(!z[0][1]){
swap(z[0][1], z[1][0]);
swap(z[1][2], z[2][1]);
swap(z[0][2], z[2][0]);
}
if(z[0][1] == z[1][2] && z[1][2] == z[2][0] && !z[1][0] && !z[2][1] && !z[0][2]){
return res + z[0][1] * 2;
}
else{
return -1;
}
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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
