diff --git "a/lkhyun/202509/07 PGM LV3 \354\225\274\352\267\274 \354\247\200\354\210\230.md" "b/lkhyun/202509/07 PGM LV3 \354\225\274\352\267\274 \354\247\200\354\210\230.md" new file mode 100644 index 00000000..5695de76 --- /dev/null +++ "b/lkhyun/202509/07 PGM LV3 \354\225\274\352\267\274 \354\247\200\354\210\230.md" @@ -0,0 +1,26 @@ +```java +import java.util.*; +class Solution { + static PriorityQueue pq = new PriorityQueue<>((a,b) -> Integer.compare(b,a)); + public long solution(int n, int[] works) { + long answer = 0; + for(int i : works){ + pq.offer(i); + } + for(int i=0;i 1){ + pq.offer(--cur); + } + }else{ + return 0; + } + } + for(int i : pq){ + answer += i*i; + } + return answer; + } +} +```