diff --git "a/khj20006/202502/11 BOJ P2 \353\266\200\354\212\244\355\204\260.md" "b/khj20006/202502/11 BOJ P2 \353\266\200\354\212\244\355\204\260.md" new file mode 100644 index 00000000..479430bd --- /dev/null +++ "b/khj20006/202502/11 BOJ P2 \353\266\200\354\212\244\355\204\260.md" @@ -0,0 +1,119 @@ +```java + +import java.util.*; +import java.io.*; + +class Point{ + int x, y, id; + Point(int x, int y, int id){ + this.x = x; + this.y = y; + this.id = id; + } +} + +class Query{ + int a, b, v, id; + Query(int a, int b, int v, int id){ + this.a = a; + this.b = b; + this.v = v; + this.id = id; + } +} + +class Edge{ + int a, b, c; + Edge(int a, int b, int c){ + this.a = a; + this.b = b; + this.c = c; + } +} + +class Main { + + // IO field + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + static StringTokenizer st; + + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() {return Integer.parseInt(st.nextToken());} + static long nextLong() {return Long.parseLong(st.nextToken());} + static void bwEnd() throws Exception {bw.flush();bw.close();} + + // Additional field + static Point[] arr; + static Query[] que; + static int[] root; + static int N, Q; + static List edges; + + public static void main(String[] args) throws Exception { + + ready(); + solve(); + + bwEnd(); + } + + static void ready() throws Exception{ + + nextLine(); + N = nextInt(); + Q = nextInt(); + root = new int[N]; + arr = new Point[N]; + for(int i=0;i(); + + } + + static void solve() throws Exception{ + + Arrays.sort(arr, (a,b) -> a.x-b.x); + for(int i=1;i a.y-b.y); + for(int i=1;i a.c-b.c); + + Arrays.sort(que, (a,b) -> a.v-b.v); + boolean[] ans = new boolean[Q]; + int idx = 0; + for(int i=0;i