Clau d'accés


Submit solution

Points: 10
Time limit: 5.0s
Memory limit: 256M

Author:
Problem types
Allowed languages
C#, Go, Java

Per tal d'entrar a un edifici secret del govern, els agents secrets han d'introduir una clau d'accés que es composa de \(N\) números enters. El sistema d'apertura de la porta disposa d'una sèrie de \(M\) números enters i, per tal d'obrir la porta, cal que els \(N\) nombres introduïts estiguin recollits al llistat de \(M\) nombres que té el sistema (no importa l'ordre).

Input Format

Primera línia:

  • \(N\): Quantitat de nombres de la clau d'apertura.

Segona línia:

  • \(Ni\): Els nombres que formen part de la clau d'apertura, cada nombre està separat del següent per un espai en blanc.

Tercera línia:

  • \(M\): Quantitat de nombres que conté el sistema d'apertura.

Segona línia:

  • \(Mi\): Els nombres que formen part del sistema d'apertura, cada nombre està separat del següent per un espai en blanc.

Constraints

  • \(N\) i \(M\) > 0~
  • \(Ni\) i \(Mi\) >= 0~

Output Format

  • Si es pot obrir la porta (tots els números introduïts apareixen al sistema): OK
  • Si no es pot obrir la porta (algun dels números introduïts no apareixen al sistema): ERROR

Sample Input 0

1
7
1
7

Sample Output 0

OK

Sample Input 1

1
7
1
25

Sample Output 1

ERROR

Sample Input 2

1
7
3
2 7 0

Sample Output 2

OK

Sample Input 3

1
7
3
25 0 19

Sample Output 3

ERROR

Sample Input 4

3
13 42 25
5
66 13 25 42 77

Sample Output 4

OK

Sample Input 5

3
7 11 17
5
9 3 23 56 21

Sample Output 5

ERROR

Sample Input 6

3
7 11 17
5
43 7 23 17 21

Sample Output 6

ERROR

Sample Input 7

4
312 5 71 91
3
91 5 312

Sample Output 7

ERROR
CC BY-NC-SA 4.0