Submission #499684

#TimeUsernameProblemLanguageResultExecution timeMemory
499684sazid_alamDNA 돌연변이 (IOI21_dna)C++17
Compilation error
0 ms0 KiB
#include "dna.h"
using namespace std;

void init(string a, string b) {
}

int get_distance(int x, int y) {
    
    init(a, b);

    int p = 0, A[2] = {}, C[2] = {}, T[2] = {};
    for(int i = x; i <= y; i++){
        if(a[i] != b[i]) p++;
        if(a[i] == 'A') A[0]++;
        if(b[i] == 'A') A[1]++;
        if(a[i] == 'C') C[0]++;
        if(b[i] == 'C') C[1]++;
        if(a[i] == 'T') T[0]++;
        if(b[i] == 'T') T[1]++;
    }

    if(A[0] != A[1] || C[0] != C[1] || T[0] != T[1]) return -1;

    if(p % 2) return p / 2 + 1;
    else return p / 2;
	return 0;
}

Compilation message (stderr)

dna.cpp: In function 'int get_distance(int, int)':
dna.cpp:9:10: error: 'a' was not declared in this scope
    9 |     init(a, b);
      |          ^
dna.cpp:9:13: error: 'b' was not declared in this scope
    9 |     init(a, b);
      |             ^