일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 백준 #다익스트라 #dijkstra #9370 #c++
- 쌤쌤쌤
- 20117
- 16202
- backtracking #codetree #디버깅 #삼성코테
- 투포인터 #백준 #boj #20922 #22862
- 백준
- C++
- N번째큰수
- 최소 #공배수 #최대 #공약수 #유클리드 #호제법 #lcm #gcd #c++ #boj #3343 #백준 #장미
- 30870
- 레드아보
- 3343
- boj #백준
- 진법변환 #2to10 #10to2 #이진법 #십진법 #변환 #bitset #c++
- c++ #입출력 #속도 #ios #sync_with_stdio #cin #cout #tie
- hcpc
- 1174
- 코딩
- 줄어드는수
- 사이클 없는 그래프
- BOJ
- graph
- graph #최단경로
- 22869
- LIS #가장긴증가하는부분수열 #
- c++ #boj #
- 호반우 상인
- 3D #Reconstruction #computer #vision #volume #metric #tsdf #kinect #fusion
- 이분탐색 #dp #11053
- Today
- Total
목록전체 글 (160)
hyunjin
https://programmers.co.kr/learn/courses/30/lessons/42842 첫 번째 방법 #include #include using namespace std; vector solution(int brown, int yellow) { vector answer; int br = (brown +4)/2; for(int y = 3,x= br-y; y =3; y++){ x = br-y; if( (y-2)* (x-2) == yellow){ answer.push_back(x); answer.push_back(y); break; } } return answer; } 풀이 방법 문제의 제한 사항을 보니 brown의 범위가 yellow 보다 작아서 brown 기준으로 문제를 풀..
https://programmers.co.kr/learn/courses/30/lessons/60057 첫 번째 풀이 #include #include #include #include using namespace std; int solution(string s) { int answer = s.length(); stack stack1; stack stack2; string unit; int cnt=0; for(int i = 1 ; i < s.length()/2+1 ;i++){ for(int j = 0; j
https://programmers.co.kr/learn/courses/30/lessons/17682 첫 번째 풀이 #include #include using namespace std; int solution(string dartResult) { int answer = 0; int tmp[3] = {0,0,0}; int level = -1; for(int i =0 ; i< dartResult.length() ; i++){ if(isdigit(dartResult[i])!=0 || dartResult[i]-'0' == 0 ){ // 숫자면 level++; tmp[level] = dartResult[i] -'0'; if(dartResult[i+1]-'0' == 0){ i++; tmp[level] = tmp[l..
https://programmers.co.kr/learn/courses/30/lessons/12915?language=cpp level1>연습문제>문자열 내 마음대로 정렬하기 첫 번째 방법 #include #include #include #include using namespace std; bool compare(pair a, pair b){ if(a.second == b.second ) return (a.first).compare(b.first)>0 ? false: true; return a.second < b.second; } vector solution(vector strings, int n) { vector answer; vector temp; for(string elem : strings){ t..
https://programmers.co.kr/learn/courses/30/lessons/12906 첫 번째 풀이 (답은 맞았으나 효율성 테스트 통과 못함) #include #include using namespace std; vector solution(vector arr) { vector answer; answer.assign(arr.begin(), arr.end()); for(vector::iterator elem = answer.begin();;){ if( (elem+1) == answer.end() ) break; if( *elem == *(elem+1)) { answer.erase(elem+1); } else{ elem++;} } return answer; } 두 번째 풀이 (실패) #inc..
https://programmers.co.kr/learn/courses/30/lessons/42748 첫 번째 풀이 #include #include using namespace std; vector solution(vector array, vector commands) { vector answer; vector temp; for(int t = 0;tkey){ temp[y+1]=temp[y]; y--; } temp[y+1]= key; } answer.push_back(temp[k]); temp...
https://programmers.co.kr/learn/courses/30/lessons/42587 예전에 시도했다가 실패한 문제다. 오랜만에 다시 풀어본다. 예전에 풀었던 실패한 방식이다. 1차 실패 class Solution { public int solution(int[] priorities, int location) { int answer = 1; int size = priorities.length,temp; int targetPrior = priorities[location]; int flag []= new int[size]; int start = 0,index; for(int i =0; i 0) { ..
https://programmers.co.kr/learn/courses/30/lessons/42576 1차 풀이 방법 #include #include #include using namespace std; string solution(vector participant, vector completion) { unordered_map hash; for (string name:completion) { if (hash.end() == hash.find(name)) hash.insert(make_pair(name, 1)); else hash[name]++; } for (string name : participant) { if (hash.end() == hash.find(name)) return name; else ..