본문 바로가기

Problem Solving102

Codeforces Round #290 (Div. 2) 2016. 1. 24.
Codeforces Round #292 (Div. 1) 2016. 1. 10.
TesterDream: A TopCoder Arena Plugin TesterDream: A TopCoder Arena PluginTesterDream is a TopCoder Arena plugin for testing your solution against example cases in external editor. It works in combination with FileEdit and CodeProcessor plugins.It will extract the example cases and insert them in your source code. When you run your program, your solution will be automatically tested against them. When you submit your source code, th.. 2016. 1. 2.
BOJ 1658 돼지 잡기 문제 링크 : Croatian Highschool Competitions in Informatics 2002 Final Exam #1 2번 - PIGS각 날에 대해 각 우리(pighouses)에 대한 상태(state)를 노드로 생성하여, 최종적으로 사람인 노드를 통해 sink로 흘려주는 그래프를 구성한 후 maximum flow로 해결하면 된다. 예제에 대한 그래프 모델링은 다음 그림과 같다. 2016. 1. 1.
Prüfer Sequence Wikipedia - Prüfer Sequence예전에 kriii가 trello에 남겨주었던 걸 다시 보고 정리하면 좋겠다 싶어서 글을 쓰게 되었다.프뤼퍼 수열은 정점이 n개인 하나의 labeled tree에 대해 유일하게 결정되는 길이가 n-2인 수열로써, 간단한 방법에 의해 생성된다.매 step마다 degree가 1인 점들 중 label이 가장 작은 정점을 지우면서 그와 연결된 정점의 번호를 프뤼퍼 수열에 추가한다.이 수열을 통해 원래의 트리도 복원 가능하므로 트리와 수열이 일대일 대응이 된다.따라서 labeled tree와 prüfer sequence과의 관계를 통해 n개의 정점을 가지는 서로 다른 labeled tree의 개수는 서로 다른 prüfer sequence의 수와 같으며 개가 된다는 것.. 2015. 12. 29.