Skip to content

Commit

Permalink
백준 1449 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
junwoochoi committed May 13, 2019
1 parent 980b9b9 commit d070fdc
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions Baekjoon1449.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,20 @@ public static void main(String[] args) throws IOException {

st = new StringTokenizer(br.readLine());

int[] pipe = new int[1001];
boolean[] pipeCheck = new boolean[1001];
int[] pipe = new int[holeCount];

for (int i = 0; i < holeCount; i++) {
pipe[i] = Integer.parseInt(st.nextToken());
}

Arrays.sort(pipe, 0, holeCount);
Arrays.sort(pipe);

int count = 0;
for (int i = 0; i < holeCount; i++) {
if (!pipeCheck[i]) {
int count = 1;
int temp = pipe[0];
for (int i = 1; i < holeCount; i++) {
if(pipe[i] - temp > tapeLength - 1){
temp = pipe[i];
count++;

for (int j = pipe[i]; j < pipe[i] + tapeLength; j++) {
if(j > 1000) break;
pipeCheck[j] = true;
}
}
}

Expand Down

0 comments on commit d070fdc

Please sign in to comment.