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.
2 parents 0a53f08 + 471a4da commit ee32faeCopy full SHA for ee32fae
0224LJH/202511/19 BOJ 서버 증설 횟수.md
@@ -0,0 +1,36 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+class Solution {
6
+ public int solution(int[] players, int m, int k) {
7
+ int len = players.length;
8
+ int[] minus = new int[len];
9
10
+ int cur = 0;
11
+ int total = 0;
12
13
+ for (int i = 0; i < len; i++){
14
+ cur -= minus[i];
15
16
+ int limit = m*(cur+1);
17
18
+ if (players[i] < limit) continue;
19
20
+ int diff = players[i] - limit;
21
22
+ int plus = diff/m + 1;
23
+ cur += plus;
24
+ total += plus;
25
26
+ if (i+k < len){
27
+ minus[i+k] = plus;
28
+ }
29
30
31
32
+ int answer = total;
33
+ return answer;
34
35
+}
36
+```
0 commit comments