일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 브루트포스
- DP
- 삼성SW 역량 테스트 기출문제
- 에라토스테네스의 체
- 2370 c++
- 백준 알고리즘
- 삼성 SW 역량 테스트 기출 문제
- C++
- 백준 1697
- 15651
- 백트레킹
- backtracking
- 백준알고리즘
- 백준 2370
- 삼성 SW역량 테스트
- 프로그래머스
- MySQL
- 시장 선거 포스터 c++
- 백준
- 주식 용어
- 주식 용어 정리
- 주린이
- 위상정렬
- 용어 정리
- 15651c++
- Programmers
- DFS
- fill함수
- 백준 15651
- Today
- Total
목록알고리즘/프로그래머스 알고리즘 (52)
빠켱이
#include #include #include using namespace std; int solution(vector d, int budget) { int answer = 0; sort(d.begin(), d.end()); int i = 0; while(1){ if(d[i] > budget || i == d.size()) break; if(d[i]
#include using namespace std; int main(void) { int a, b; scanf("%d %d", &a, &b); for(int i = 0; i < b; i++){ for(int j = 0; j < a; j++){ printf("*"); } printf("\n"); } return 0; }
#include #include #include using namespace std; int max_check(vector& v, int y){ int temp = 0; for(int i = 0; i < 4; i++) if(i != y) temp = max(temp, v[i]); return temp; } int solution(vector land){ int answer = 0; for(size_t i = 1; i < land.size(); i++){ for(int j = 0; j < 4; j++){ land[i][j] += max_check(land[i - 1], j); answer = max(answer, land[i][j]); } } return answer; }
#include #include #include #include using namespace std; string solution(string s) { string answer = ""; string tmp; vector v; stringstream stream; stream.str(s); while(stream >> tmp) v.push_back(tmp); vector num; for(int i = 0; i < v.size(); i++) num.push_back(stoi(v[i])); sort(num.begin(), num.end()); printf("%d", num.size()); answer += to_string(num[0]); answer += " "; answer += to_string(num..
#include #include #include using namespace std; int solution(vector A, vector B){ int answer = 0; sort(A.begin(), A.end()); sort(B.begin(), B.end(), greater()); for(int i = 0; i < A.size(); i++) answer += A[i] * B[i]; return answer; }
#include #include #include #include using namespace std; vector solution(vector record) { vector answer; vector list; map m; for(int i = 0; i > tmp) v.push_back(tmp); if(v[0] != "Change") list.push_back({v[0], v[1]}); if(v[0] != "Leave"){ if(m.find(v[1]) == m.end()) m.insert({v[1],v[2]}); else ..