# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
697762 | hiikunZ | DNA 돌연변이 (IOI21_dna) | C++17 | 65 ms | 16684 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
using ll = long long int;
vector<vector<ll>> R(9,vector<ll>(200000,0));
void init(string a, string b){
ll N = (ll)a.size();
for(ll i = 0;i < N;i++){
ll p,q;
if(a[i] == 'A') p = 0;
if(a[i] == 'T') p = 1;
if(a[i] == 'C') p = 2;
if(b[i] == 'A') q = 0;
if(b[i] == 'T') q = 1;
if(b[i] == 'C') q = 2;
for(ll j = 0;j < 9;j++) R[j][i + 1] = R[j][i];
R[p * 3 + q][i + 1]++;
}
}
int get_distance(int x, int y){
y++;
ll ans = 0;
vector<int> A(9);
for(ll j = 0;j < 9;j++) A[j] = R[j][y] - R[j][x];
vector<ll> C(3);
for(ll i = 0;i < 3;i++){
for(ll j = 0;j < 3;j++){
C[i] += A[i * 3 + j];
C[j] -= A[i * 3 + j];
}
}
if(C[0] != 0 || C[1] != 0 || C[2] != 0) return -1;
for(ll i = 0;i < 3;i++){
A[i * 3 + i] = 0;
for(ll j = i + 1;j < 3;j++){
ll k = min(A[i * 3 + j],A[j * 3 + i]);
A[i * 3 + j] -= k;
A[j * 3 + i] -= k;
ans += k;
}
}
ll w = 0;
for(int i = 0;i < 9;i++) w += A[i];
if(w != 0) w--;
return ans + w;
}
컴파일 시 표준 에러 (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... |