PS

스택인가?

yunny_world 2023. 7. 21. 02:40

https://www.acmicpc.net/problem/8240

 

8240번: Take-out

In the first line of the standard input there are two integers, n and k (2 ≤ n ≤ 1,000,000, 1 ≤ k ≤ n-1), separated by a single space, that denote the total number of blocks used in the game, and the number of white blocks per black node (to be rem

www.acmicpc.net

오늘 이 문제를 풀고 언제 스택을 떠올려야 하는지에 대해 한 번 생각해 보게 되었다.

위가 아래보다 더 자주 보이는 상황인데, 위 상황은 처리하는 방식이 되게 다양한 것 같다. 

아래 상황이라고 해서 잘 안나오는 건 아닌데, 아래 상황이라면 적어도 한 번은 스택을 이용한 풀이를 사용하는 것을 고려해 볼만 한 것 같다.

'PS' 카테고리의 다른 글

[AtCoder] E - Digit Sum Divisible  (5) 2024.01.15
[BOJ] 25057번 : Evolution of Weasels  (0) 2024.01.04
PS 근황과 계획  (4) 2023.05.14
"map병장 메모리제한에 패배"  (2) 2023.05.05
3/20~3/21 업다운랜디  (2) 2023.03.21