일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- porquerolles
- 1654
- 그린델발트 자전거
- 알고리즘
- 대학생
- C++
- 군대
- 프랑스 남부 섬
- 백준으로 C++ 공부
- 군대코딩
- 백준
- Replit
- 오리스프
- C++ 공부하기
- 24524
- 백준으로 c++ 공부하기
- iles dHyeres
- C++ 공부
- 군인
- 16236 c++
- 피르스트 자전거
- 로이커바트 숙소
- openai api
- 융프라우 스위스 패스
- 로이커바트
- auto code review
- 코딩
- 백준 C++
- 그린델발트 캠핑장
- 시뮬레이션
- Today
- Total
목록알고리즘 (11)
기억보다는 기록을 해볼까

음 맨 처음에 숫자를 문자열로 받을지 아니면 정수형으로 받을지 고민함. 좀 오래거림 큐에 string형도 넣을 수 있다. 이런 식으로 string 형에 출력을 할 때 + "문자" 식으로도 출력을 할 수 있다. cout ans; dfs(); cout

하.. 한문제 골치 아프게 계속 안풀렸다. 오늘 공부한 백준 : 5430 AC #include #include #include using namespace std; int main() { int T; cin >> T; while(T--) { deque dq; string str; cin >> str; int n; cin >> n; string arr; cin >> arr; bool right = true; bool end = false; for(int i = 0 ; i < arr.size(); i++) { if(arr[i] == '[' || arr[i] == ',' || arr[i] == ']') continue; int num = arr[i] - '0'; while(arr[i + 1] != ',' &&..

오늘 공부한 백준 18870 미완성, 1260 18870 좌표압출 어렵네 1260 DFS, BFS void dfs(int num) { vst[num] = true; cout

1주일 간의 휴가를 끝내고 다시 공부 모드로 돌입해야겠다 오늘 공부한 백준 (11047, 11279, 11724) 11724 연결요소의 개수 DFS, BFS를 제대로 구현할 줄 알면 간단한 문제이다 문제는 내가 제대로 할 줄을 모르는 것이다. 두고두고 잘 봐야하는 기본 문제이다. #include #include using namespace std; const int MAXN = 1001; bool map[MAXN][MAXN] = {0, }; bool vst[MAXN]; int n, m; int cnt = 0; void dfs(int num) { vst[num] = true; for(int i = 1; i > n >> m; for(int i = 0; i > ..

오늘 공부한 백준 5525 IOIOI #include #include using namespace std; int main() { int n, m; string str; cin >> n >> m; cin >> str; int ans = 0; for(int i = 0; i < m; i++){ int Onum = 0; if(str[i] == 'I'){ while(str[i + 1] == 'O' && str[i + 2] == 'I') { Onum++; if(Onum == n){ Onum--; ans++; } i += 2; } if(Onum != 0){ v.push_back(Onum); } } } cout

오늘 공부한 백준 9461, 11399, 11659, 11726, 11727 ㄹㅇ 내가 맞는것 같은데 이게 왜 틀림? 이러면 범위가 더 넓은 자료형으로 바꿔보자

오늘 공부한 백준 2606, 2630, 9095, 9375 2606 바이러스 DFS로 풀었다. 방문 했는지도 확인 해야함 int dfs(int num) { if(arr[num] == UNVISITED){ arr[num] = VISITED; cnt++; for(int i = 0; i < v[num].size(); i++){ int c = v[num][i]; dfs(c); } } return cnt; } 2630 색종이 만들기 void check(int stCol, int stRow, int n) { flag = 0; int stcolor = map[stCol][stRow]; for(int i = stCol; i < stCol + n; i++){ for(int j = stRow; j < stRow + n; ..

오늘 공부한 백준 11723, 1003, 1463, 17626, 2579 다이내믹 프로그래밍 과거에 구한 해를 활용하는 알고리즘 구하는 경로가 고정되어 있는 해를 구할 때 유용 1003 (피보나치 함수) int fibonacci(int n) { dp[n][0] = dp[n-1][0]+dp[n-2][0]; dp[n][1] = dp[n-1][1]+dp[n-2][1]; return 0; } 1463 (1 만들기) //미리 만들어 놓는다 dp[1] = 0; for(int i = 2; i

오늘 공부한 백준 1966, 2805, 1929 1966 큐는 push, pop, front 벡터는 push_back while(num--){ //num번 반복 queue q; vector v; int n, m; cin >> n >> m; for(int i = 0; i > input; v.push_back(input); q.push({i, input}); } sort(v.begin(), v.end(), compare); int cnt = 0; int i = 0; while(!q.empty()){ int a = q.front().first; int b = q.front().second; if(v[i] == q.front().second){ q.pop(); +..