개발 일지
-
백준 4963번 C++ 풀이카테고리 없음 2018. 11. 19. 23:15
#include #include #include #include #include #include using namespace std; int buffer[51][51]; int delta[8][2] = { {1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1} ,{-1, -1}, {1, -1}, {-1,1} }; int main(){ cin.tie(NULL); ios::sync_with_stdio(false); int n, m; cin >> n >> m; while ( !( n == 0 && m == 0 )){ for (auto y = 0; y buffer[x][y]; } } int land = 0; for (auto y = 0; y m; } return 0; }
-
[GIT] 여러 개 커밋 합치기카테고리 없음 2018. 11. 19. 15:45
로컬에서 작업한 커밋을 서버에 올리기 전에,커밋내역을 합치고 싶을 때가 있습니다. 그 때 쓰는 명령어입니다. git rebase -i HEAD~3 커밋 세개를 합치고 싶을 때는 HEAD~3을 붙입니다..그러면 입력창이 뜨는데 pick adsdf [커밋1]pick adsadf [커밋2]pick asdfq [커밋3] 이렇게 뜹니다. 첫번째 커밋빼고 나머지 밑엣거 전부pick를 squash로 바꿔줍니다. :wq를 입력하면 바로 커밋수정내역이 자동으로 생성되는데.. 세개의 커밋 메시지를 합친 것이 출력됩니다. 별다른 사항 없으면 :wq로 커밋 메시지 확정.
-
[GIT] 마지 커밋을 cherry-pick 하기카테고리 없음 2018. 11. 19. 11:25
https://stackoverflow.com/questions/9229301/git-cherry-pick-says-38c74d-is-a-merge-but-no-m-option-was-given 관련 스택오버플로우.. 마지된 커밋을 cherry-pick할 때는fatal: Commit fd9f57850f6b94b7906e5bbe51a0d75bf638c74d is a merge but no -m option was given. 라는 메시지가 뜨면서 에러 메시지가 출력되는데요.이는 아마도 마지되면서 두 브랜치 가 합쳐졌는데,둘 중 어느쪽의 변경 사항을 체리-픽할것이냐를 묻는 에러인 듯 싶습니다. 결론적으로 어떤 브랜치를 베이스로 해야하는데.. git cherry-pick -m 1 fd9f578 같은 명령어로 ..
-
백준 1799번 C++ 풀이카테고리 없음 2018. 11. 19. 00:22
시간초과의 엄청난 고통..#include #include #include #include #include #include using namespace std; int n; int buffer[10][10]; int maxBishop[2]; bool isPlaceable(int,int); void dfs(int x, int y, int currentBishop, int color){ if (x >= n){ if (x % 2 == 0) x=1; else x=0; y++; } while (y < n){ // cout
-
백준 1764번 c++ 풀이백준 2018. 11. 18. 19:55
map의 해시성을 이용하면 상수 시간~ O(n) 안에 해결가능합니다. #include #include #include #include #include #include using namespace std; int main(){ cin.tie(NULL); ios::sync_with_stdio(false); int n, m; map hash; cin >> n >> m; for (auto i=0; i> temp; hash[temp]++; } for (auto i=0; i> temp; hash[temp]++; } priority_queue pq; for (auto i : hash){ if (i.second == 2){ pq.push(i.first); } } cout