vov44k

Untitled

Dec 12th, 2021 (edited)
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. public class L_1429_W {
  4.     static StreamTokenizer in;
  5.     static PrintWriter out;
  6.  
  7.     static int nextInt() throws IOException {
  8.         in.nextToken();
  9.         return (int) in.nval;
  10.     }
  11.  
  12.     public static void main(String[] args) throws IOException {
  13.         in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
  14.         out = new PrintWriter(System.out);
  15.  
  16.         int L;
  17.         int N;
  18.         int M;
  19.         L = nextInt();
  20.         N = nextInt();
  21.         M = nextInt();
  22.  
  23.         int[] arr = new int[L + 1];
  24.  
  25.         int[] big = new int[N];
  26.         int[] fin = new int[N];
  27.         for (int v = 0; v < N; v++) {
  28.             big[v] = nextInt();
  29.             fin[v] = nextInt();
  30.             for (int j = big[v]; j <= fin[v]; j++) {
  31.                 arr[j]++;
  32.             }
  33.         }
  34.  
  35.         int[] point = new int[M];
  36.         for (int g = 0; g < M; g++) {
  37.             point[g] = nextInt();
  38.         }
  39.  
  40.  
  41.         for (int g = 0; g < M; g++) {
  42.             out.println(arr[point[g]] + " ");
  43.         }
  44.     }
  45. }
Add Comment
Please, Sign In to add comment