Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package uri;
- import java.util.Scanner;
- public class uri1800 {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int[] Q;
- int[] E;
- int n, x, y, i, si, key = 0, a = 0, b = 0;
- n = input.nextInt();
- x = input.nextInt();
- E = new int[x];
- for(si = 0; si < x; si++) {
- E[si] = input.nextInt();
- }
- Q = new int[n];
- for(i = 0; i < n; i++) {
- Q[i] = input.nextInt();
- }
- for(i = 0; i < n; i++) {
- key = Q[i];
- for(i = 0; i < x; i++) {
- if(E[i] == key) {
- a++;
- }
- }
- for(y = 0; y < i; y++) {
- if(Q[y] == key) {
- b++;
- }
- }
- if((a == 0) && (b == 0)) {
- System.out.println("1");
- }
- if((a != 0) || (b != 0)) {
- System.out.println("0");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement