# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1001944 | hacizadal | DNA 돌연변이 (IOI21_dna) | C++17 | 1566 ms | 3932 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dna.h"
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define pll pair<ll, ll>
string s, t;
void init(std::string a, std::string b) {
s = a;
t = b;
}
int get_distance(int x, int y) {
string k = s.substr(x, y-x+1);
string g = t.substr(x, y-x+1);
string a = k;
string b = g;
sort(a.begin(), a.end());
sort(b.begin(), b.end());
if (a != b){
return -1;
}
if (k == g){
return 0;
}
ll c = 0, d = 0;
for (ll i = 0; i<k.length(); i++){
if (k[i] != g[i]){
if (k[i] == 'A') c++;
else d++;
}
}
if (d > c) swap(d, c);
return c;
}
컴파일 시 표준 에러 (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... |