PS 짬통/골랜디
23567 Double Rainbow
kimximya
2023. 8. 31. 17:48
https://www.acmicpc.net/problem/23567
23567번: Double Rainbow
Let $P$ be a set of $n$ points on the $x$-axis and each of the points is colored with one of the colors $1, 2, \dots , k$. For each color 𝑖 of the 𝑘 colors, there is at least one point in $P$ which is colored with $i$. For a set $P'$ of consecutive p
www.acmicpc.net
빡세다, 문제 이해하는 것부터 시간이 좀 걸린다
가능한 P' 집합 포문으로 다 검사하면 시간초과 난다
투포인터로 풀어야한다
증명은 안되어있는데 잘 모르겠다
부분집합이 Rainbow 인지 체크할 때 좀 더 최적화가 가능한데 귀찮아서 안했다
https://github.com/KimximyaFan/Random-Defense/blob/main/C0004.java