제출 #1228324

#제출 시각아이디문제언어결과실행 시간메모리
1228324bornagMutating DNA (IOI21_dna)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define pb push_back
#define eb emplace_back
#define upb upper_bound
#define lpb lower_bound
#define ppb pop_back
#define X first
#define Y second
#define all(a) a.begin(), a.end()
#define len(a) (int) (a.size())

const ll MOD = 1e9 + 7;
const ll BASE = 32;
const int MAXN = 1e5 + 7;

int pref[MAXN][7][10];
int same[MAXN];

void init(string a, string b) {
	
	for(int i = 0; i < len(a); i++) {
		for(int j = 0; j < 2; j++)
			for(int k = 0; k < 3; k++)
				pref[i + 1][j][k] += pref[i][j][k];
				
		pref[i + 1][1][(b[i] == 'A' ? 0 : (b[i] == 'C' ? 1 : 2))]++;
		pref[i + 1][0][(a[i] == 'A' ? 0 : (a[i] == 'C' ? 1 : 2))]++;
		same[i + 1] = same[i] + !(a[i] == b[i]);
	}
}

int get_distance(int x, int y) {
	x++, y++;
	if(pref[y][1][0] - pref[x - 1][1][0] != pref[y][0][0] - pref[x - 1][0][0]
		|| pref[y][1][1] - pref[x - 1][1][1] != pref[y][0][1] - pref[x - 1][0][1]
		|| pref[y][1][2] - pref[x - 1][1][2] != pref[y][0][2] - pref[x - 1][0][2])
			return -1;
	
	return (same[y] - same[x - 1]) / 2 + ((same[y] - same[x - 1]) % 2);
}

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

dna.cpp:6:14: error: 'll' was not declared in this scope; did you mean 'all'?
    6 | typedef pair<ll, ll> pll;
      |              ^~
      |              all
dna.cpp:6:18: error: 'll' was not declared in this scope; did you mean 'all'?
    6 | typedef pair<ll, ll> pll;
      |                  ^~
      |                  all
dna.cpp:6:20: error: template argument 1 is invalid
    6 | typedef pair<ll, ll> pll;
      |                    ^
dna.cpp:6:20: error: template argument 2 is invalid
dna.cpp:8:16: error: 'll' was not declared in this scope; did you mean 'pll'?
    8 | typedef vector<ll> vll;
      |                ^~
      |                pll
dna.cpp:8:18: error: template argument 1 is invalid
    8 | typedef vector<ll> vll;
      |                  ^
dna.cpp:8:18: error: template argument 2 is invalid
dna.cpp:22:7: error: 'll' does not name a type; did you mean 'vll'?
   22 | const ll MOD = 1e9 + 7;
      |       ^~
      |       vll
dna.cpp:23:7: error: 'll' does not name a type; did you mean 'vll'?
   23 | const ll BASE = 32;
      |       ^~
      |       vll