오늘의 문제! https://www.acmicpc.net/problem/15748 입력 첫줄에 L N rF rB 가 순서대로 주어지고 이어서 N개의 줄에 xi Ci가 주어진다 풀이 Ci의 값이 가장 큰 위치에서 쉬는게 가장 이득이다 가장 큰 곳에서 쉬고 그다음으로 가장 큰 곳에서 쉬는 식으로 하는게 가장 높은 값을 얻을 수 있다. 예를 들어 10 5 4 3 1 3 3 7 4 5 6 6 7 3 이라고 하면 선택할 쉼터는 (3,7) (6,6) (7,3) 이 되는 식이다 소스 Ci의 값이 최대인 경우만 바라보면 되기 때문에 힙을 사용했다. 현재위치는 curPoi 변수를 사용해서 확인해줬으며 xi의 값이 curPoi보다 작은경우는 넘어가 줬다. 1234567891011121314151617181920212223..
박트리님의 게시글중 https://baactree.tistory.com/14?category=735523 를 참고해서 알고리즘을 공부하고 있다 지금 내가 보고 있는 부분은 알고리즘 초급... 초급 알고리즘 내용을 보니 https://blog.naver.com/kks227/220775134486 내용을 추천해줬다 그래서 해당 내용에 의해 탐욕적기법부터 공부하고 있다 오늘의 문제는! https://www.acmicpc.net/problem/13904 입력 첫줄에 N이 주어지고 그다음 N개의 줄에 d와 w가 주어진다. d는 마감까지 남은 날, w는 해당 과제를 끝냈을 때 얻는 점수이다 풀이 처음엔 앞에서 부터 풀려고 했으나 선택지가 너무 많다 생각이 들어 바로 노선을 변경 뒤에서 시작하니 선택지가 많이 줄었다..
백준 10989번 문제 사이트 : https://www.acmicpc.net/problem/10989 #include #include #include #include using namespace std; #define Max 10002 int Array[Max]; int main(void) { int input; scanf("%d", &input); for (int i = 0; i < input; i++) { int number; scanf("%d", &number); Array[number]++; } for (int i = 1; i < Max; i++) { for (int l = 0; l < Array[i]; l++) { printf("%d\n", i); } } return 0; }
백준 2750번 문제 사이트 : https://www.acmicpc.net/problem/2750 #include #include #include #include using namespace std; int Array[Max]; int main(void) { int input; scanf("%d", &input); for (int i = 0; i < input; i++) { scanf("%d", &Array[i]); } sort(Array, Array + input); for (int i = 0; i < input; i++) { printf("%d\n", Array[i]); } return 0; }
백준 1475번 문제 사이트 : https://www.acmicpc.net/problem/1475 #include #include #include #include using namespace std; #define Max 11 int Array[Max]; int main(void) { int input; scanf("%d", &input); if (input) { int num = log10(input) + 1; for (int i = 0; i < num; i++) { int index = input % 10; if (index == 6 || index == 9) { Array[6]++; } else { Array[input % 10]++; } input = input / 10; } int max = 0..
백준 10250번 문제 사이트 : https://www.acmicpc.net/problem/10250 #include #include #include #include using namespace std; #define Max 100 int Array[Max * Max]; int main(void) { int Testcase; scanf("%d", &Testcase); for (int T = 0; T < Testcase; T++) { int H,W,N; int index = 1; scanf("%d %d %d", &H, &W, &N); for (int w = 1; w
백준 2775번 문제 사이트 : https://www.acmicpc.net/problem/2775 #include #include #include #include using namespace std; #define Max 15 int Map[Max][Max]; int main(void) { for (int x = 0; x < Max; x++) { Map[0][x] = x+1; } for (int y = 1; y < Max; y++) { Map[y][0] = 1; } for (int y = 1; y < Max; y++) { for (int x = 1; x < Max; x++) { Map[y][x] = Map[y][x-1] + Map[y-1][x]; } } int Testcase; scanf("%d", &T..
백준 1193번 문제 사이트 : https://www.acmicpc.net/problem/1193 #include #include #include #include using namespace std; int main(void) { int input; scanf("%d", &input); if (input == 1) { printf("1"); } else { int sum = 0; int Up, Down; int n = 1; for (;; n++) { sum = sum + n; if (sum
- Total
- Today
- Yesterday
- apple
- Human Interface Guidelines
- DP
- 디자인패턴
- UIView
- 온라인저지
- 싱글톤
- storage
- 분할정복
- HumanInterfaceGuidelines
- 오토레이아웃
- Swift
- MVC
- Human Interface Guideline
- 부스트코스
- 알고리즘
- Firebase
- HIG
- ios
- 백준
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |