[BOJ] 10800. 컬러볼
https://www.acmicpc.net/problem/10800 접근 방법 class Ball implements Comparable{ int index, color, size; public Ball(int index, int color, int size) { this.index = index; this.color = color; this.size = size; } @Override public int compareTo(Ball o) { return size-o.size; } } // 자료구조형은 이렇게 가져간다. 공을 크기 순으로 정렬을 먼저하였다. 이제 문제는 같은 색깔에 대한 구슬의 크기는 잡아먹지 않아야한다. 그러기 위해서는 (누적값 - 같은색깔의 누적값) 을 해주면 된다. int[] answ..
2021.09.18