Submission #1150549

#TimeUsernameProblemLanguageResultExecution timeMemory
1150549zhasynDNA 돌연변이 (IOI21_dna)C++20
0 / 100
17 ms2880 KiB
#include "dna.h"
#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
using namespace std;
#define F first
#define S second
typedef long long ll;
#define pii pair <int, int>
#define pll pair <ll, ll>
typedef long double ld;
const ll N = 1e5 + 100, M = 4096 + 10, len = 21, inf = 1e18;
const ll mod = 1e9 + 7;

string a, b;
int n;
void init(string ax, string bx) {
	a = ax;
	b = bx;
	n = (int)a.size();
}
vector <int> vec[6];
int get_distance(int x, int y) {
	int ans = 0;
	for(int i = x, code; i <= y; i++){
		if(a[i] == b[i]) continue;
		if(a[i] == 'A'){
			if(b[i] == 'C') code = 2;
			else code = 0;
		}
		if(a[i] == 'T'){
			if(b[i] == 'A') code = 1;
			else code = 4;
		}
		if(a[i] == 'C'){
			if(b[i] == 'A') code = 3;
			else code = 5;
		}
		vec[code].pb(i);
	}
	for(int i = 0; i <= 4; i += 2){
		if((int)vec[i].size() != (int)vec[i + 1].size()) return -1;
		for(int j = 0; j < (int)vec[i].size(); j++){
			ans += abs(vec[i][j] - vec[i + 1][j]);//
		}
	}
	return ans;
}





// int main(){
  	// ios::sync_with_stdio(false);
  	// cin.tie(NULL);
//   	
  // return 0;
// }

 
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...