| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1312270 | opeleklanos | DNA 돌연변이 (IOI21_dna) | C++20 | 18 ms | 2352 KiB |
#include <iostream>
#include <vector>
#include "dna.h"
using namespace std;
string a;
string b;
#define C first
#define A second.first
#define T second.second
void init(string a1, string b1){
a = a1;
b = b1;
}
int get_distance(int x, int y){
if(x == y){
if(a[x] == b[x]) return 0;
else return -1;
}
if(y - x == 1){
if(a[x] == b[x]){
if(a[y] == b[y]) return 0;
else return -1;
}
if(a[x] == b[y]){
if(a[y] == b[x]) return 1;
else return -1;
}
return -1;
}
if(y-x == 2){
pair<int, pair<int, int>> o;
for(int i = x; i<=y; i++){
if(a[i] == 'C') o.C++;
if(a[i] == 'A') o.A++;
if(a[i] == 'T') o.T++;
}
for(int i = x; i<=y; i++){
if(b[i] == 'C') o.C--;
if(b[i] == 'A') o.A--;
if(b[i] == 'T') o.T--;
}
if(o.C != 0 || o.A != 0 || o.T != 0) return -1;
int same = 0;
for(int i = x; i<=y; i++) same += (a[i] == b[i]);
if(same == 1) return 1;
if(same == 0) return 2;
if(same == 3) return 0;
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... | ||||
