전체 글(334)
-
[BOJ] 13913번 : 숨바꼭질 4
1. problem : https://www.acmicpc.net/problem/13913 2. solution 1 :#include using namespace std;#define X first #define Y second int n, k;pair axis[200005]; int dx[2] = { 1,-1 };queue Q;int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> k; fill(axis, axis + 200005, make_pair(-1, -1)); axis[n] = { 0,n }; // cnt 와 전 index값 입력 Q.push(n); bool isfind = false; while (!Q.empty()) { ..
2024.09.19 -
[BOJ] 6593번 : 상범 빌딩
1. problem : https://www.acmicpc.net/problem/6593 2. solution 1 :#include using namespace std;char board[32][32][32]; int dx[6] = { 0,1,0,-1,0,0 }; int dy[6] = { 1,0,-1,0,0,0 }; int dz[6] = { 0,0,0,0,1,-1 };queue> Q;int main(void) { ios::sync_with_stdio(0); cin.tie(0); while (true) { int L, R, C; cin >> L >> R >> C; int isvis[32][32][32] = {}; while (!Q.empty()) Q.pop(); if (L == 0 && R ..
2024.09.19 -
[BOJ] 2468번 : 안전 영역
1. problem : https://www.acmicpc.net/problem/2468 2. solution 1 :#include using namespace std;#define X first #define Y secondint n; int board[105][105]; int dx[4] = { 0,1,0,-1 };int dy[4] = { 1,0,-1,0 };queue> Q;int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; int mx_ht = 0, mn_ht = INT_MAX; for (int i = 0; i > board[i][j]; mx_ht = max(mx_ht, board[i][j]); mn_ht = min(mn_ht,..
2024.09.18 -
[BOJ] 5014번 : 스타트링크
1. problem : https://www.acmicpc.net/problem/5014 2. solution 1: #include using namespace std;int f, s, g, u, d; typedef long long ll;long long elev[1000005]; // 몇번째에 도착했는지 기록 ; queue Q; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> f >> s >> g >> u >> d; elev[s] = 1; Q.push(s); int dx[2] = { u,-d }; while (!Q.empty()) { int cur = Q.front(); Q.pop(); for (int dir = 0; dir ..
2024.09.18 -
[BioPython] BLAST
0. BLAST란? BLAST란 Basic Local Alignment Search Tool의 줄임말이다. 쉽게 말해서, 내가 알고 있는 Seq와 유사한 Seq가 있는지 찾아주는 알고리즘이다. "바이오파이썬으로 만나는 생물정보학"에 좋은 예시가 있어, 여기서 설명한다. 어떤 질병이 있는 환자 A가 있다. 우리는 이 질병이 어떤 seq가 변이가 되어, 생긴 건지 알고 싶다. 따라서, 환자의 seq를 채취해 , sequencing 회사에 보냈다. 결과 파일을 받았고, Alignment 한 결과, 인간의 genome과 matching 되지 않는 부분이 있음을 발견했다. 그렇다면, 이 부분은 과연 어떤 종에서 유래된 seq란 말인가? 이때, BLAST를 이용한다. BLAST결과 streptococcus pneu..
2024.09.18 -
[BOJ] 2748번 : 피보나치 수 2
1. problem : https://www.acmicpc.net/problem/2748 2. solution 1 :#include using namespace std;int n;long long dp[100]; long long dynamic_func(int k) { if (k == 0 || k == 1) { return k; } if (dp[k]) return dp[k]; return dp[k] = dynamic_func(k-1) + dynamic_func(k-2);}int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; long long ans = dynamic_func(n); cout dp를 이용하여, 해결하였다. 단순 재귀를 이..
2024.09.18