Skip to content

Instantly share code, notes, and snippets.

@dalcon10028
Created June 27, 2020 16:18
Show Gist options
  • Save dalcon10028/97688a419bd37c624aedc17e80f07d6a to your computer and use it in GitHub Desktop.
Save dalcon10028/97688a419bd37c624aedc17e80f07d6a to your computer and use it in GitHub Desktop.
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] num = new int[20000001];
int n = sc.nextInt();
for(int i=0; i<n; i++) num[sc.nextInt()+10000000]++;
int m = sc.nextInt();
for(int i=0; i<m; i++) System.out.print(num[sc.nextInt()+10000000]+" ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment