10256번: 돌연변이 - Aho-Corasick
marker의 돌연변이 구조를 전부 만들고 Trie에 저장, 아호 코라식으로 DNA 구조를 확인하면 된다.돌연변이 구조를 만들 때 구현에 유의하자.메모리가 생각보다 빡빡해서 A, C, G, T만 자식으로 저장해야 한다.#include using namespace std;typedef long long ll;typedef pair pii;typedef pair pll;typedef tuple tiii;const int MAXTR = 1000001;const int MAXAL = 4;int N, M;string DNA, marker;int node = 1;int root = 0;int trie[MAXTR][MAXAL];bool exist[MAXTR];int fail[MAXTR];queue qu;void in..
알고리즘/baekjoon
2024. 8. 12. 17:22