| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 437089 | WnRS | Mutating DNA (IOI21_dna) | C++17 | 47 ms | 4796 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dna.h"
#include <bits/stdc++.h>
using namespace std;
string a,b;
vector<pair<int,int>>va,vb;
vector<int>dif;
void gen(void) {
va.resize(a.length()+1);
vb.resize(b.length()+1);
dif.resize(a.length()+1);
va[0]={0,0},vb[0]={0,0};
dif[0]=0;
for(int i = 0 ; i < a.size() ; i++) {
va[i+1]=va[i],vb[i+1]=vb[i],dif[i+1]=dif[i];
if(a[i]=='A') va[i+1].first++;
else if(a[i]=='C') va[i+1].second++;
if(b[i]=='A') vb[i+1].first++;
else if(b[i]=='C') vb[i+1].second++;
if(a[i] != b[i]) dif[i+1]++;
} return;
}
int get_distance(int x, int y) {
int aa=va[y+1].first-va[x].first,cc=va[y+1].second-va[x].second;
if(aa-(vb[y+1].first-vb[x].first) || cc-(vb[y+1].second-vb[x].second)) {
return -1;
}
return (dif[y+1]-dif[x]+1)/2;
}
void init(string aa, string bb) {
a=aa,b=bb;
gen();
}컴파일 시 표준 에러 (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... | ||||
