-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_3009.java
More file actions
53 lines (46 loc) ยท 1.18 KB
/
_3009.java
File metadata and controls
53 lines (46 loc) ยท 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package backjoon;
// https://www.acmicpc.net/problem/3009
// ๋ค ๋ฒ์งธ ์
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class _3009 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// sol memory 11452 runtime 76
// ์ง์ฌ๊ฐํ์ด ๋๊ธฐ ์ํด์๋ ์์ ์ด๋ฃจ์ง ์๋ ์ซ์๋ฅผ ์ฐพ์ผ๋ฉด ๋จ
String[] coord_1 = br.readLine().split(" ");
String[] coord_2 = br.readLine().split(" ");
String[] coord_3 = br.readLine().split(" ");
String x;
String y;
// x ์ขํ ๋น๊ตํด์ ์์ด ์๋ x์ขํ ์ฐพ๊ธฐ
if(coord_1[0].equals(coord_2[0])){
x = coord_3[0];
} else if (coord_1[0].equals(coord_3[0])) {
x = coord_2[0];
} else {
x = coord_1[0];
}
// y ์ขํ ๋น๊ตํด์ ์์ด ์๋ y์ขํ ์ฐพ๊ธฐ
if (coord_1[1].equals(coord_2[1])) {
y = coord_3[1];
} else if (coord_1[1].equals(coord_3[1])) {
y = coord_2[1];
} else {
y = coord_1[1];
}
System.out.println(x + " " + y);
}
}
/*
INPUT
30 20
10 10
10 20
20 30
10 10
20 10
OUTPUT
30 10
*/