Algorithms/Coding_Contest

    [그래프 위상정렬] Topological Sort : Java

    [그래프 위상정렬] Topological Sort : Java

    그래프 위상정렬: Topological Sort BFS&DFS를 계속 공부하다가 위상정렬도 요즘 핫(?)하다길래 따로 공부하는 중이다. 위상정렬은 그래프 정렬의 일종인데 이것이 가능하기 위해선 순환성을 가져서는 안된다. 즉 순환없는 방향성을 가진 계층적 정렬이 가능해야 위상정렬이 가능하다. 조건식으로 나타내면 다음과 같다. 1. 1 -> 2 -> 3 -> 4 와 같은 관계가 성립되어야 한다. 2. A -> B | B

    [NWERC 2006] Printer Queue [Java]

    [NWERC 2006] Printer Queue [Java]

    The only printer in the computer science students' union is experiencing an extremely heavy workload. Sometimes there are a hundred jobs in the printer queue and you may have to wait for hours to get a single page of output. Because some jobs are more important than others, the Hacker General has invented and implemented a simple priority system for the print job queue. Now, each job is assigned..

    [Codeforce/round#611] Minutes Before the New Year [Java]

    [Codeforce/round#611] Minutes Before the New Year [Java]

    time limit per test 1 second memory limit per test 256 megabytes input: standard input output: standard output New Year is coming and you are excited to know how many minutes remain before the New Year. You know that currently the clock shows ℎh hours and 𝑚m minutes, where 0≤ℎℎ