-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
103 additions
and
8 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+922 Bytes
out/production/classes/algorithm/programmers/Integer_in_two_circles.class
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package algorithm; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.util.StringTokenizer; | ||
|
||
public class _19523 { | ||
|
||
public static void main(String[] args) throws IOException { | ||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
StringTokenizer st = new StringTokenizer(br.readLine()); | ||
|
||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package algorithm; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
|
||
public class _27323 { | ||
|
||
public static void main(String[] args) throws IOException { | ||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
|
||
int a = Integer.parseInt(br.readLine()); | ||
int b = Integer.parseInt(br.readLine()); | ||
|
||
System.out.println(a * b); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/algorithm/programmers/Integer_in_two_circles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package algorithm.programmers; | ||
|
||
public class Integer_in_two_circles { | ||
|
||
public long solution(int r1, int r2) { | ||
|
||
|
||
return answer; | ||
} | ||
|
||
public static void main(String[] args) { | ||
Integer_in_two_circles ts = new Integer_in_two_circles(); | ||
int r1 = 2; | ||
int r2 = 4; | ||
ts.solution(r1, r2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package algorithm.programmers; | ||
|
||
import java.util.Arrays; | ||
|
||
public class Target_System { | ||
|
||
public int solution(int[][] targets) { | ||
int answer = 0; | ||
int end = 0; | ||
// 2번째 원소 오름차순 | ||
Arrays.sort(targets, (o1, o2) -> o1[1] - o2[1]); | ||
for (int [] target : targets) { | ||
int s = target[0]; | ||
int e = target[1]; | ||
// 첫번째가 end 보다 작다면 넘어감 (범위 안에 존재한다는 뜻) | ||
if (s < end) continue; | ||
// 그렇지 않다면 범위를 벗어난다는 의미임으로 갱신 및 미사일 갯수 증가 | ||
else end = e; answer += 1; | ||
} | ||
return answer; | ||
} | ||
|
||
public static void main(String[] args) { | ||
Target_System ts = new Target_System(); | ||
int[][] targets = {{4,5},{4,8},{10,14},{11,13},{5,12},{3,7},{1,4}}; | ||
ts.solution(targets); | ||
} | ||
} |