| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 964640 | KasymK | DNA 돌연변이 (IOI21_dna) | C++17 | 1523 ms | 2624 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dna.h"
#include "bits/stdc++.h"
using namespace std;
string s, s2;
int coun(string k, char c){
int sm = 0;
for(int i = 0; i < k.size(); ++i)
sm += (k[i] == c);
return sm;
}
void init(string a, string b){
s = a;
s2 = b;
}
int get_distance(int x, int y){
int ret = -1;
string cyn_s = s.substr(x, y);
string cyn_s2 = s2.substr(x, y);
int cnt_a_s = coun(cyn_s, 'A');
int cnt_c_s = coun(cyn_s, 'C');
int cnt_t_s = coun(cyn_s, 'T');
int cnt_a_s2 = coun(cyn_s2, 'A');
int cnt_c_s2 = coun(cyn_s2, 'C');
int cnt_t_s2 = coun(cyn_s2, 'T');
if(cnt_a_s != cnt_a_s2 or cnt_t_s != cnt_t_s2 or cnt_c_s != cnt_c_s2)
return ret;
if(cyn_s == cyn_s2){
ret = 0;
return ret;
}
for(int i = 0; i < cyn_s.size(); ++i)
ret += (cyn_s[i] != cyn_s2[i]);
return ret;
}
// int main(){
// int n, q;
// scanf("%d%d", &n, &q);
// string a, b;
// cin >> a >> b;
// init(a, b);
// while(q--){
// int l, r;
// scanf("%d%d", &l, &r);
// if(r - l <= 2)
// printf("%d\n", get_distance(l, r));
// else
// puts("COZUM YOK");
// }
// 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... | ||||
