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

2차원 배열로 육각형 타일을 직접 구현하였다. ↗↑↖↙↓↘의 패턴이 처음엔 각각 ( 1, 0, 1, 1, 1, 1) 의 횟수만큼 나타나고 1씩 증가한다. 두 번째엔 (2, 1, 2, 2, 2, 2) 만큼, 세 번째엔 (3, 2, 3, 3, 3, 3) ... 이런 식으로 나타난다. 이걸 잘 구현해서 문제를 해결하였다. n이 50일 때 출력한 모습이다. #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int dRow[6] = { -1,-2,-1,1,2,1 }..

1. 내 아두이노를 방향에 맞게 이동시킨다. 이때, 이동한 곳에 미친 아두이노가 있으면 종료한다. 2. 미친 아두이노를 내 아두이노의 거리가 가장 짧게 되는 지점으로 이동시킨다. 3. 모든 미친 아두이노를 이동시킨 뒤 한 공간에 두 개 이상의 미친 아두이노가 있으면 그 공간에 있는 모든 아두이노를 없앤다. 4. 미친 아두이노가 내 아두이노와 만났다면 종료한다. #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int r, c; string moveStr; int dRow[..

왼쪽 아래에서부터 가장자리를 타고 오른쪽 위까지 자라는 정도가 감소하지 않는다고 했기 때문에 직접 자라는 정도를 입력받는 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..