일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 백트래킹
- 문자열
- BFS
- 구현
- 백준
- 다이나믹 프로그래밍
- 알고리즘
- 다익스트라
- 스택
- XR Interaction Toolkit
- 그래프
- 유니티
- Unreal Engine 5
- ue5
- 정렬
- 자료구조
- 수학
- 유니온 파인드
- 트리
- VR
- 우선순위 큐
- 시뮬레이션
- 재귀
- DFS
- 브루트포스
- 누적 합
- 그리디 알고리즘
- Team Fortress 2
- 투 포인터
- c++
- Today
- Total
목록구현 (132)
1일1알

왼쪽 아래에서부터 가장자리를 타고 오른쪽 위까지 자라는 정도가 감소하지 않는다고 했기 때문에 직접 자라는 정도를 입력받는 0열을 제외한 열들은 자기 위의 값과 같은 값을 가지게 된다. 자라는 정도가 감소하지 않기 때문에 자기 위에서 자라는 정도가 가장 크기 때문이다. 0행과 0열의 값만 구해주고, 나머지 원소들은 자기 위의 값을 출력하면 된다. 그리고 자라는 정도가 0일 경우에는 아무 행동도 하지 않아도 된다. #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int m,..

직원과 선물을 구조체로 관리하면서 1초마다 일어나는 상황을 전부 시뮬레이션 하면서 문제를 해결하였다. 다른 사람들 코드는 내 코드보다 엄청 짧던데 어떻게 저렇게 짧게 짜는거지... #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int b, n, m; int ans = 0; int findRow[3] = { 1,0,-1 }; int findCol[3] = { 0,1,0 }; int dRow[3] = { 0,1,0 }; int dCol[3] = { 1,0,-1 }; str..

주사위는 마주 보는 면의 합이 7이기 때문에 세 면의 정보만 알고 있으면 어디로 구르든 다음 위에 오는 숫자의 정보를 알 수 있다. 그리고 4번 구르면 원래 상태와 같아지기 때문에 많이 가야하는 경우는 이것을 이용해 한번에 이동할 수 있다. 그리고 행*열*주사위 최고 수 = 100000*100000*6 은 int 범위를 넘어가기 때문에 주의해야 한다. #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int dRow[4] = { 0,1,0,1 }; int dCol[4] =..

가까운 쓰레기장부터 방문하면서 실었는데 용량을 넘기거나 실었는데 용량이 가득 찼을 때 처음으로 되돌아가서 버리고 다시 온다. #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t; cin >> t; while (t--) { int w, n; cin >> w >> n; vector trash(n); for (int i = 0; i..

문제에 쓰여있는 대로 구현을 했는데 구현하는데 시간이 꽤 걸렸다. 생각보다 까다로웠던 문제였다. #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; vector v(11, vector(5)); vector visited(11, false); vector th; int origin_match = 0; int match_max = 100; void Solve() { bool isOrigin = true; for (int i = 0; i < 5; i++) { v[1][i] = t..

visited 배열을 이용했는데, bool이 아닌 int로 사용하였다. 아무것도 없는 공간은 가로로 간 곳을 세로로 다시 갈 수 있기 때문에 고려하지 않았고, /와 \인 경우만 고려했는데, /의 경우에는 왼쪽과 위쪽에서 오는 경우 visited를 1로 하고, 오른쪽과 아래쪽에서 오는 경우는 visited를 2로 하였다. 백슬래시의 경우에도 선을 기준으로 왼쪽은 1, 오른쪽은 2로 하였다. visited가 1일 때 1로 설정한 곳에서 오거나 2일때 2로 설정한 곳에서 오면 무한히 반복되는 것이다. 그리고 visited가 3이면 양쪽 다 이미 들린 상태에서 또 들린 것이기 때문에 이것도 무한히 반복된다. 이걸 구현하는 게 쉽지는 않았다. #include #include #include #include #in..