일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- review
- Recursive
- 코딩 테스트
- silver
- 알고리즘
- 영화
- Greedy
- health
- 카카오
- BOJ
- 나는솔로
- BFS
- 넷플릭스
- Movie
- 리뷰
- array
- 백준
- benefits
- 추천
- 영어
- coding
- 해설
- 2020
- 완전탐색
- parametric search
- Algorithm
- kakao
- usaco
- 수능
- Netflix
- Today
- Total
목록코딩 테스트 대비 추천 문제 (38)
Young
규칙 (i, j) --> (j, n - i - 1) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 int mp[101][101]; void rotate() { int mp2[101][101]; for (int i = 0; i
https://www.acmicpc.net/problem/16927 16927번: 배열 돌리기 2 크기가 N×M인 배열이 있을 때, 배열을 돌려보려고 한다. 배열은 다음과 같이 반시계 방향으로 돌려야 한다. A[1][1] ← A[1][2] ← A[1][3] ← A[1][4] ← A[1][5] ↓ ↑ A[2][1] A[2][2] ← A[2][3] ← A[2][4] A[2][5] ↓ ↓ ↑ ↑ A[3][1] A[3][2] → A[3][3] → A[3][4] A[3][5] ↓ ↑ A[4][1] → A[4][2] → A[4][3] → A[4][4] → A[4 www.acmicpc.net 그냥 구현 문제입니다. 주어지는 R 값이 매우 큰데 이대로 한 칸씩 돌리면서 돌면 당연히 시간초과가 나겠죠. 배열의 고리의 길..
거듭제곱을 조금 더 효율적으로 하는 recursive 함수입니다. 시간 복잡도는 O(logN) 입니다. 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 #include #include #include #include #define endl '\n' #define FastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; typedef long long ll; ll power(int a, int b) { if (b == 0) return 1; if (b == 1) return a; ll ret = power(a, b >> 1); if (b & 1) re..
https://www.acmicpc.net/problem/14454 14454번: Secret Cow Code The cows are experimenting with secret codes, and have devised a method for creating an infinite-length string to be used as part of one of their codes. Given a string s, let F(s) be s followed by s "rotated" one character to the right (in a right rotation www.acmicpc.net 제가 영어를 잘 못해서 해석이 어려웠지만, 예제를 한 번 보니 이해를 단번에 해버렸습니다. N 값보다 문자열의 길..
https://www.acmicpc.net/problem/14453 14453번: Hoof, Paper, Scissors (Silver) You have probably heard of the game "Rock, Paper, Scissors". The cows like to play a similar game they call "Hoof, Paper, Scissors". The rules of "Hoof, Paper, Scissors" are simple. Two cows play against each-other. They both count to three and then each s www.acmicpc.net 이번 문제는 prefix sum 문제 입니다. 하나의 구간에 H / P / S 중 가장..
https://www.acmicpc.net/problem/14452 14452번: Cow Dance Show After several months of rehearsal, the cows are just about ready to put on their annual dance performance; this year they are performing the famous bovine ballet "Cowpelia". The only aspect of the show that remains to be determined is the size of the stage www.acmicpc.net 스테이지 크기가 k라고 했을 때, 소들이 어떻게 댄스 공연을 마치는지 시뮬레이션하는게 쉽지는 않다. 그냥 구현하라고..
https://www.acmicpc.net/problem/14466 14466번: 소가 길을 건너간 이유 6 문제 소가 길을 건너간 이유는 그냥 길이 많아서이다. 존의 농장에는 길이 너무 많아서, 길을 건너지 않고서는 별로 돌아다닐 수가 없다. 존의 농장에 대대적인 개편이 있었다. 이제 작은 정사각형 목초지가 N×N (2 ≤ N ≤ 100) 격자로 이루어져 있다. 인접한 목초지 사이는 일반적으로 자유롭게 건너갈 수 있지만, 그 중 일부는 길을 건너야 한다. 농장의 바깥에는 높은 울타리가 있어서 소가 농장 밖으로 나갈 일은 없다. K마리의 (1 ≤ K ≤ 100, www.acmicpc.net 개인적으로 해석을 문제를 햇갈리게 하여, 영어로 문제를 읽는걸 추천한다. (r,c) - (r`,c`) 의 의미는 이..
https://www.acmicpc.net/problem/14172 14172번: Moocast Write a single line of output containing the maximum number of cows a broadcast from a single cow can reach. The originating cow is included in this number. www.acmicpc.net 소들이 메시지 전달할 수 있는지는 O(N^2)으로 모두 조사합니다. 문제에도 나와있지만, 한 가지만 주의하면 됩니다. (A -> B로 갈 수 있다) != (B - > A로 갈 수 있다) 두 소의 워키토키의 power에 따라 메시지를 보낼 수 있는지를 조사해봐야 합니다. 모두 조사를 한 다음, 모든 소들을 ..