일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 30870
- 줄어드는수
- 사이클 없는 그래프
- c++ #boj #
- 쌤쌤쌤
- LIS #가장긴증가하는부분수열 #
- 투포인터 #백준 #boj #20922 #22862
- boj #백준
- 호반우 상인
- 진법변환 #2to10 #10to2 #이진법 #십진법 #변환 #bitset #c++
- 백준
- c++ #입출력 #속도 #ios #sync_with_stdio #cin #cout #tie
- 최소 #공배수 #최대 #공약수 #유클리드 #호제법 #lcm #gcd #c++ #boj #3343 #백준 #장미
- N번째큰수
- 1174
- 3343
- 이분탐색 #dp #11053
- 20117
- hcpc
- graph
- 16202
- 레드아보
- 3D #Reconstruction #computer #vision #volume #metric #tsdf #kinect #fusion
- 22869
- backtracking #codetree #디버깅 #삼성코테
- C++
- 백준 #다익스트라 #dijkstra #9370 #c++
- 코딩
- BOJ
- graph #최단경로
- Today
- Total
목록전체 글 (160)
hyunjin
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/QgqDm/btqHU8Btk2u/N6NUqkjyrnvjwXlFmmiZPK/img.png)
[1012] #include #include using namespace std; int main(void){ float number; cin>>number; cout
백준 골드바흐의 추측 바로가기 [소스 코드] #include #include #include #include using namespace std; bool isPrime(int num) { if (num == 1) return false; if (num == 2) return true; for (int i = 2; i > size; string res; int prime[10001] = {0,}; for (int k = 2; k > num; for (int i = 2; i num - 2 * prime[i]) { g2 = num - prime[i]; g1 = prime[i]; } } res += to_string(g1 )+ " " + to_string(g2) +"\n"; } cout
프로그래머스/해시/위장 바로가기 [소스 코드] #include #include #include using namespace std; int solution(vector clothes) { int answer = 1; unordered_map hash; for(vector pair : clothes) hash[pair[1]]++; unordered_map :: iterator it; for(it = hash.begin(); it != hash.end() ; it++){ answer = answer*(it->second +1 ); } return answer-1; } 다른 사람 풀이를 참고 했다. [풀이 전략] 1. 이 문제의 핵심은 최소 한 개의 의상을 뽑는 것이다. 여러 경우의 수에서 최소 한 개 이상을..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/JtTrx/btqHhRfYLol/sNk03RekQNV22n58AMopiK/img.png)
백준 달팽이는 올라가고 싶다 바로가기 ※시간 제한 0.15초라는 것에 주의 [첫 번째 풀이] => 시간 초과 #include using namespace std; int main(void){ int up,down,len,day=0; cin >> up >> down >> len; day = len / (up - down); cout 실패 #include using namespace std; int main(void){ int up, down, des,day; cin >> up >> down >> des; day = ceil((float)des / (up - down))-1; if (des == up) day=1; return 0; } 일부 케이스에서 성립이 안된다. [세 번째 풀이] #include usi..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/sTB9F/btqGHywdKIT/RJYKdMYycRB6VX4pmbVam0/img.png)
백준 분수 찾기 바로가기 [소스 코드] #include using namespace std; int main(void){ int x,line=1,result=0; cin >> x; while ((line) * (line + 1) / 2 < x) line++; result = x - line * (line - 1) / 2; if (line % 2 == 1) cout
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/se8Dq/btqGJwjfjpq/d6krbuW8ieiKTMZgHn7pyK/img.png)
백준 수학1 벌집 바로가기 [문제 간단 설명] N(1 ≤ N ≤ 1,000,000,000)이 주어지면 1에서부터 몇 칸을 걸쳐야 갈 수 있는지 출력하기 예를 들면, 13까지는 3개, 58까지는 5개를 지난다. [소스 코드] #include using namespace std; int main(void){ int num,result=1; cin >> num; if (num == 1) { cout
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bP8bEa/btqGC67SX5U/ljsXqccm8tUmFI2H5dKnQ0/img.png)
백준 손익분기점(1712) 바로가기 [문제 요약] 고정 비용, 제품의 가변 비용, 판매 요금이 입력으로 들어 올 때 손익이 나는 지점(0이 넘는 포인트, 같아도 안됨)이 언제인지 출력 단, 없는 경우엔 -1을 출력 [소스 코드] #include using namespace std; int main(void){ int fixed, vari, price; cin >> fixed >> vari>>price ; if (vari >= price) cout
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/2LOUK/btqGEaO8RHK/SCgvkkTeRS9lEd81iBCeY1/img.png)
백준 다이얼 바로가기 [첫 번째 풀이 방법] - 가장 쉽게 A-Z 까지의 switch 문을 사용해서 풀었다. - C++의 stream을 안쓰고 C의 stream을 사용하려고 노력했으나 왜 컴파일 오류가 나는지 모르겠다. 찾기 싫다. 결론적으로 틀린 곳을 못찾고 그냥 지워버렸다. [두 번째 풀이] #include #include using namespace std; int main(void){ string dial; cin >> dial; int res = 0; for (char c : dial) { int num = (int)c - 'A'; if (num >= 18) num--; if (num >= 23) num--; res = res + num/3+3; } cout