We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5f08c0 commit 08fe7bcCopy full SHA for 08fe7bc
ksinji/202510/24 PGM 입국심사.md
@@ -0,0 +1,33 @@
1
+```java
2
+import java.util.*;
3
+
4
+class Solution {
5
+ public long solution(int n, int[] times) {
6
+ Arrays.sort(times);
7
+ long min = 1;
8
9
+ long max = (long) times[times.length-1]*n;
10
+ long mid = 0;
11
+ long sum;
12
+ long answer = max;
13
14
+ while(min <= max) {
15
+ sum = 0;
16
+ mid = (min + max) / 2;
17
18
+ for(int time : times) {
19
+ sum += mid / time;
20
+ }
21
22
+ if(sum >= n) {
23
+ answer = mid;
24
+ max = mid - 1;
25
26
+ else {
27
+ min = mid + 1;
28
29
30
+```
31
+ return answer;
32
33
+}
0 commit comments