제출 #1008595

#제출 시각아이디문제언어결과실행 시간메모리
1008595induwara16DNA 돌연변이 (IOI21_dna)C++17
0 / 100
1545 ms3420 KiB
#include <bits/stdc++.h>

using namespace std;

typedef string str;
typedef vector<int> vi;

str a, b;

void init(std::string a1, std::string b2)
{
	a = a1;
	b = b2;
}

int solve(str a, str b, int c)
{
	;
}

int get_distance(int x, int y)
{
	str a1 = a.substr(x, y);
	str b1 = b.substr(x, y);
	int n = a1.length(), c = 0;

	if (
		(count(a1.begin(), a1.end(), 'A') != count(b1.begin(), b1.end(), 'A')) ||
		(count(a1.begin(), a1.end(), 'B') != count(b1.begin(), b1.end(), 'B')) ||
		(count(a1.begin(), a1.end(), 'C') != count(b1.begin(), b1.end(), 'C')))
	{
		return -1;
	}

	for (int i = 0; i < n; i++)
	{
		if (a1[i] != b1[i])
			c++;
	}

	return c / 2;
}

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

dna.cpp: In function 'int solve(str, str, int)':
dna.cpp:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
#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...