Submission #480827

#TimeUsernameProblemLanguageResultExecution timeMemory
480827PoPularPlusPlusDNA 돌연변이 (IOI21_dna)C++17
Compilation error
0 ms0 KiB
#include "dna.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long 
#define pb(e) push_back(e)
#define sv(a) sort(a.begin(),a.end())
#define sa(a,n) sort(a,a+n)
#define mp(a,b) make_pair(a,b)
#define vf first
#define vs second
#define ar array
#define all(x) x.begin(),x.end()
const int inf = 0x3f3f3f3f;
const int mod = 1000000007; 
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
bool remender(ll a , ll b){return a%b;}

const int N = 100002;

void init(std::string a, std::string b) {
	
}

int get_distance(int x, int y) {
	int n1 = 0 , n2 = 0 , n3 = 0;
	int t1 = 0, t2 = 0, t3 = 0;
	for(int i = x; i <= y; i++){
		if(a[i]!=b[i]){
			if(a[i] == 'A')t1++;
			else if(a[i] == 'T')t2++;
			else t3++;
			if(b[i] == 'A')n1++;
			else if)b[i] == 'B')n2++;
			else n3++;
		}
	}
	if(n1 == t1 && n2 == t2 && n3 == t3){
		int c = n1 + n2 + n3;
		if(c == 3)return 2;
		if(c == 0)return 0;
		return 1;
	}
	return -1;
}

Compilation message (stderr)

dna.cpp: In function 'int get_distance(int, int)':
dna.cpp:29:6: error: 'a' was not declared in this scope
   29 |   if(a[i]!=b[i]){
      |      ^
dna.cpp:29:12: error: 'b' was not declared in this scope
   29 |   if(a[i]!=b[i]){
      |            ^
dna.cpp:34:11: error: expected '(' before ')' token
   34 |    else if)b[i] == 'B')n2++;
      |           ^
      |           (
dna.cpp:35:4: error: expected '}' before 'else'
   35 |    else n3++;
      |    ^~~~
dna.cpp:29:17: note: to match this '{'
   29 |   if(a[i]!=b[i]){
      |                 ^
dna.cpp:26:15: warning: unused variable 'n2' [-Wunused-variable]
   26 |  int n1 = 0 , n2 = 0 , n3 = 0;
      |               ^~
dna.cpp:37:2: warning: no return statement in function returning non-void [-Wreturn-type]
   37 |  }
      |  ^
dna.cpp: At global scope:
dna.cpp:38:2: error: expected unqualified-id before 'if'
   38 |  if(n1 == t1 && n2 == t2 && n3 == t3){
      |  ^~
dna.cpp:44:2: error: expected unqualified-id before 'return'
   44 |  return -1;
      |  ^~~~~~
dna.cpp:45:1: error: expected declaration before '}' token
   45 | }
      | ^