제출 #1150753

#제출 시각아이디문제언어결과실행 시간메모리
1150753zhasynDNA 돌연변이 (IOI21_dna)C++20
컴파일 에러
0 ms0 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;
		ans += (int)Cvec[i].size();
	}
	return ans;
}

// int main(){
//   	ios::sync_with_stdio(false);
//   	cin.tie(NULL);
//   	string ax, bx;
//   	cin >> ax >> bx;
//   	init(ax, bx);
//   	cout << get_distance(3, 5);
//   return 0;
// }

 

컴파일 시 표준 에러 (stderr) 메시지

dna.cpp: In function 'int get_distance(int, int)':
dna.cpp:43:29: error: 'Cvec' was not declared in this scope; did you mean 'vec'?
   43 |                 ans += (int)Cvec[i].size();
      |                             ^~~~
      |                             vec