
A - 3:12 가장 어린 나이를 찾고, 시계방향으로 돌면서 이름을 출력하면 된다. #include #include #include #include #include #include #define MINF 0x7f7f7f7f #define INF 300000000000001 #define MOD 10007 #define NUM 200010 #define X first #define Y second using namespace std; typedef long long ll; typedef pair pii; typedef pair pdd; typedef pair pil; typedef pair piii; typedef pair piiii; typedef pair pll; typedef pair plll; ty..

C - Almost Equal AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp 길이가 M인 문자열 N개가 주어진다. 우리가 해결해야 하는 문제는 이 문자열 N개를 랜덤하게 rearrange 했을때, i번째 문자열과 i+1번째 문자열의 차이가 1이 되게 만들 수 있는가?를 풀어야 한다. 아무리 단순하게 생각해봐도 이걸 해결하기 위한 알고리즘은 떠오르지가 않았다. 정렬로는 절대로 해결할 수 없고.. 전부 확인해야 하는것 아닌가?라는 생각이 들어 제한을 봤는데, N의 범위는 2이상 8이하로 주어진 것을 볼 수 있다. 그러면 문..

E - A Gift From the Stars AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp 문제 해석이 좀 어렵다. 트리가 주어지고, 여기서 star를 찾고자 하는 문제이다. 각 노드는 단 하나의 star에만 속할 수 있고, K - star는 star node와 연결된 노드의 개수로 결정이 된다. 그리고 Tree 형태로 주어지기 때문에 모든 노드는 star에 속할 수 밖에 없다. 문제를 위와같이 이해하면 DFS를 떠올려 볼 수 있다. 그리고 star 노드와 연결된 노드의 개수는 미리 O(N)으로 전처리 해놓을 수 있으..

D - Shift vs. CapsLock AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp Caps를 누른 상태인지에 따라 2가지 케이스로 나눌 수 있는데, 이를 활용하면 다이나믹 프로그래밍으로 풀 수 있는 문제이다. DP라는 것을 파악했다면 아주 간단하게 점화식을 세울 수 있는데, 이전 상태에 따라 caps가 켜졌는지, 꺼졌는지에 대해 2가지 케이스를 나누면 된다. 그리고 현재 입력해야 하는 문자열이 'A'인지 'a' 인지에 따라 최솟값을 갱신해 주면 된다. 약간의 함정은 꼭 z를 누르고 x를 눌러야 하는 것이 아니라는 ..
- Total
- Today
- Yesterday
- Operating System
- Database
- effective
- mmu
- algorithm
- java
- 공지
- cs
- network
- spring
- Effective Java
- fiber
- paging
- OS
- ARP
- soft delete
- GORM
- go
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |