Problem:


Score: 200 points

Problem Statement

You are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.

According to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:

All even numbers written on the document are divisible by 3 or 5.

If the immigrant should be allowed entry according to the regulation, output APPROVED; otherwise, print DENIED.

Notes

The condition in the statement can be rephrased as "If x is an even number written on the document, x is divisible by 3 or 5".
Here "if" and "or" are logical terms.

Constraints

All values in input are integers.

1 \leq N \leq 100

1 \leq A_i \leq 1000

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 \dots A_N

Output

If the immigrant should be allowed entry according to the regulation, print APPROVED; otherwise, print DENIED.

Sample Input 1

5
6 7 9 10 31

Sample Output 1

APPROVED

The even numbers written on the document are 6 and 10.

All of them are divisible by 3 or 5, so the immigrant should be allowed entry.

Sample Input 2

3
28 27 24

Sample Output 2

DENIED

28 violates the condition, so the immigrant should not be allowed entry.



Sample input:
5
6 7 9 10 31


Sample output:
APPROVED

Submission status: Wrong Answer

Solution code:
N = int(input())
lis = list(map(int,input().split()))
result = "DENIED"
for i in lis:
    if i %2 ==0:
        if i %3 ==0 or i%5 ==0:
            result = "APPROVED"
        else :
            print(i)
            result = "DENIED"
            break
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
lis = list(map(int,input().split()))
result = "DENIED"
for i in range(N):
    if i %2 ==0:
        if i %3 ==0 or i%5 ==0:
            result = "APPROVED"
        else :
            result = "DENIED"
            break
print(result)

Submission status: Wrong Answer

Solution code:
input()
a = [int(x) for x in input().split()]
flag = 0
for i in a:
  if(i % 2 == 0):
    if(i % 3 != 0 and i % 5 != 0):
      flag = 1
    else:
      break
if(flag == 1):	print('DENIED')
else:
  print('APPROVED')

Submission status: Wrong Answer

Solution code:
n=int(input())
list=list(map(int,input().split()))
ans=1
for i in range(len(list)):
    if list[i]%2==0:
        if list[i]%3==0 or list[i]%5==0:
            ans=0
        else:
            ans=1
            break
print("APPROVED" if ans==0 else "DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
flag =0
for i in range(n):
    if A[i] %2 == 0:
        if A[i] %3== 0 or A[i]%5==0:
            pass
        else:
            flag = 1
        break
if flag == 0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
# input
N = int(input())
A = list(map(int, input().split()))

# check
app_fl = True
for Ai in A:
    if Ai % 2 == 0 and (Ai % 3 != 0 or Ai % 5 != 0):
        app_fl = False
        break

if app_fl is True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
# input
N = int(input())
A = list(map(int, input().split()))

# check
app_fl = True
for Ai in A:
    if Ai % 3 != 0 or Ai % 5 != 0:
        app_fl = False
        break

if app_fl is True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = input()
A = list(map(str, input().split()))
B=[]
C=[]
l=[]
m=[]
n=0
i=0
for a in range(int(N)):
    if int(A[a])%2==0:
       B.append(A[a])
       i=i+1
print(B)
for a in range(int(i)):
    if int(B[a])%3==0 or int(B[a])%5==0:
       n=n+1
print(n,i)
if n==i:
   print("APPROVED")
else:
   print("DENIED")

Submission status: Wrong Answer

Solution code:
N = input()
A = list(map(str, input().split()))
B=[]
C=[]
l=[]
m=[]
i=0
for a in range(int(N)):
    if int(A[a])%2==0:
       B.append(A[a])
       i=i+1
for a in range(int(i)):
    if not int(B[a])%3==0 or int(B[a])%5==0:
       C=1
    else:
       C=0
if C==1:
   print("DENIED")
else:
   print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = input()
A = list(map(str, input().split()))
B=[]
C=[]
l=[]
m=[]
i=0
for a in range(int(N)):
    if int(A[a])%2==0:
       B.append(A[a])
       i=i+1
print(B)
for a in range(int(i)):
    if not int(B[a])%3==0 or int(B[a])%5==0:
       C=1
    else:
       C=0
print(C)
if C==1:
   print("DENIED")
else:
   print("APPROVED")

Submission status: Wrong Answer

Solution code:
N =int(input())
Alist=list(map(int,input().split()))

for i in range(N):
    if Alist[i]%2==0:
        if Alist[i]%3==0 or Alist[i]%5==0:
            continue
        else:
            print("DENIED")
            break
    if i==(N-1):
        print("APPROVED")

Submission status: Wrong Answer

Solution code:
#########行列読み込み ##############################################
"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""
##################################################################
#########入力系####################################################
"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""
##################################################################
n = int(input())
A = list(map(int,input().split()))	
cnt = 0
cnt_ = 0
for i in A:
    if i%2==0:
        cnt +=1
        if i%3==0 and i%5==0:
            cnt_ +=1
if cnt==cnt_:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N=int(input())
l=[int(x) for x in input().rstrip().split()]
flag=0
for i in l:
  if i%2==0:
    if (i%5==0 or i%3==0):
      flag=1
    else:
      flag=0
      break
if flag==1:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())
l = map(int,input().split())

isDenyed = False

for x in l :
   if x % 2 == 0 :
       if (x % 3 == 0) or (x % 5 == 0) :
           continue
       else :
           isDenyed = True
           print('x = %d' % x)
           break

if isDenyed :
    print('DENIED')
else :
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 'DENIED'
for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            ans = 'APPROVED'
        else:
            break
    else:
        ans = 'APPROVED'
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a=[i for i in a if i%2==0]
for i in a:
  if i%3==0 or i%5==0:
    continue
  else:
    print("DENIED")
    break
  print("APPROVED")

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

N = int(input())
A = list(map(int,input().split()))
for i in A:
    if i%2 == 0 and i%3 != 0 and i%5 != 0:
        print("DENIED")
        sys.exit()
print("APPEOVED")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
p = 0
for i in range(n):
    
    if a[i]%2 == 0 and a[i]%3 != 0:
        p += 1
    else:
        p = p
    if a[i]%2 == 0 and a[i]%5 != 0:
        p += 1
    else:
        p = p
if p > 0:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
p = 0
for i in range(n):
    
    if a[i]%2 == 0 and a[i]%3 != 0:
        p += 1
    else:
        p = 0
    if a[i]%2 == 0 and a[i]%5 != 0:
        p += 1
    else:
        p = 0
if p > 0:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            ans.append(1)
        else:
            ans.append(-1)
if len(set(ans)) == 1 or len(set(ans)) == 0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            ans.append(1)
        else:
            ans.append(-1)
if len(set(ans)) == 1:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())

L = list(map(int, input().split()))
S=set()
for i in range(n):
	if L[i]%2==0:
		S.add(L[i])
p=0
for s in S:
	if s%3!=0 or s%5!=0:
		print('DENIED')
		p+=1
		break

if p==0:
	print('APPROVED')

Submission status: Wrong Answer

Solution code:
x = input()
y = input()
list = y.split()
even_list = []
result = ''

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
  else:
    result = "DENIED"
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APPROVED"
  else:
    result = "DENIED"
    break
    
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))

flag = 0
for x in a:
  if x%2==0 and (x%3 and x%5):
    flag = 1
if flag:
  print("DEBIED")
else :
  print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())
L = list(map(int, input().split()))

ans = "APPROVED"
for i in range(N):
  if L[i]%2 == 0:
    if L[i]%3 == 0 and L[i]%5 == 0:
      pass
    else:
      ans = "DENIED"
      break
      
print(ans)

Submission status: Wrong Answer

Solution code:
x = input()
y = input()
list = y.split()
even_list = []
result = ''

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APPROVED"
  else:
    result = "DENIED"
    break
    
print(result)

Submission status: Wrong Answer

Solution code:
x = input()
y = input()
list = y.split()
even_list = []
result = ''

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APROVED"
  else:
    result = "DENIED"
    break
    
print(result)

Submission status: Wrong Answer

Solution code:
x = input()
y = input()
list = y.split()
result = []

for i in list:
  i = int(i)
  if i % 2 == 0 and  (i % 3 == 0 or i % 5 == 0):
      print("APROVED")
      break
  else:
      print("DENIED")
      break

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))

b=0
for i in range(n-1):
  if a[i]%2==1:
    b +=0
  else:
    if a[i]%3 ==0 or a[i]%5==0:
      b +=0
    else:
      b +=1
      
if b == 0:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in a:
  if i%2 ==0 and (i%3 !=0 or i%5 != 0):
    ans += 1
  else:
    pass
  
if ans >0:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in a:
  if i%2 ==0 and (i%3 ==0 or i%5 == 0):
    ans += 1
  else:
    pass
  
if ans >0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
num = int(input())
lst = list(map(int,input().split()))
count = 0
counta = 0
for i in range(num):
  if lst[i] % 2 == 0:
    count += 1
    if lst[i] % 3 == 0 or lst[i] % 5 == 0:
      counta += 1
if count == counta and count > 0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)

for i in range(n):
    if a[i]%2 == 0:
        if a[i]%3 == 0 or a[i]%5 == 0:
            continue
        else:
            print("DENIED")
            break
    if i == n-1:
        print("APPROVED")
        break

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)

for i in range(n):
    if a[i]%2 == 0:
        if a[i]%3 == 0 or a[i]%5 == 0:
            continue
        else:
            print("DENIED")
            break
    if i == n-1:
        print("APPROVED")

Submission status: Wrong Answer

Solution code:

n=int(input())
a=list(map(int,input().split()))
for i in range(len(a)):
    if a[i]%2==0:
        if a[i]%3!=0 and a[i]%5!=0:
            print('DENIED')
            break
            
            
print('APPROVED')

Submission status: Wrong Answer

Solution code:
import sys
n=int(input())
a=list(map(int,input().split()))
for i in range(len(a)):
    if a[i]%2==0:
        if a[i]%3!=0 and a[i]%5!=0:
            print('DENIED')
            print(a[i])
            exit()
print('APPROVED')

Submission status: Wrong Answer

Solution code:
import sys
n=int(input())
a=list(map(int,input().split()))
for i in range(len(a)):
    if a[i]%2==0:
        if a[i]%3!=0 and a[i]%5!=0:
            print('DENIED')
            print(a[i])
            sys.exit()
print('APPROVED')

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline().rstrip())
li = list(map(int, sys.stdin.readline().split()))
li2 = []
for i in li:
  if not i % 2:
    li2.append(i)
if len(li2):
  flag = True
else:
  flag = False
for i in li2:
  if i % 3 and i % 5:
    flag = False
    break
print('APPROVED' if flag else 'DENIED')

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline().rstrip())
li = list(map(int, sys.stdin.readline().split()))
li2 = []
for i in li:
  if not i % 2:
    li2.append(i)
if len(li2):
  flag = True
else:
  flag = False
for i in li2:
  if not i % 3 and i % 5:
    flag = False
    break
print('APPROVED' if flag else 'DENIED')

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline().rstrip())
li = list(map(int, sys.stdin.readline().split()))
li2 = []
for i in li:
  if not i % 2:
    li2.append(i)
if len(li2):
  flag = True
else:
  flag = False
for i in li2:
  if not i % 3 and not i % 5:
    flag = False
    break
print('APPROVED' if flag else 'DENIED')

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline().rstrip())
li = list(map(int, sys.stdin.readline().split()))
li2 = []
for i in li:
  if not i % 2:
    li2.append(i)
if not len(li2):
  flag = True
else:
  flag = False
for i in li2:
  if not i % 3 and not i % 5:
    flag = False
    break
print('APPROVED' if flag else 'DENIED')

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline().rstrip())
li = list(map(int, sys.stdin.readline().split()))
li2 = []
for i in li:
  if not i % 2:
    li2.append(i)
flag = True
for i in li2:
  if not i % 3 and not i % 5:
    flag = False
    break
print('APPROVED' if flag else 'DENIED')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def main():
    n = int(input())
    A = list(map(int, input().split()))
    ans = "APPROVED"
    for a in A:
        if a % 2 == 0:
            if a % 3 != 0 or a % 5 != 0:
                ans = "DENIED"
    print(ans) 

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

As = [int(n) for n in input().split()]

for A in As:
    if A % 2 == 0:
        if not(A % 3 == 0 or A % 5 == 0):
            print('DENIED')
            sys.exit(0)

print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
flag = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if a % 3 != 0:
            if a % 5 != 0:
                flag = 'DENIED'
            break
print(flag)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
flag = 'APPROVED'
for a in A:
    print(a)
    if a % 2 == 0:
        if a % 3 != 0:
            if a % 5 != 0:
                flag = 'DENIED'
            break
print(flag)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = list(map(int, input().split()))
for i in range(N):
    if l[i] % 2 == 0:
        if l[i] % 3 != 0 and l[i] % 5 != 0:
            ans = 'DENIED'
            break
ans = 'APPROVED'
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
count = 0
ans = 0
for i in a:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            ans += 1
if count == ans:
    print('APPROVED')
else:
    print('DEFINED')

Submission status: Wrong Answer

Solution code:
    # getting input on a variable 
aa = input()
a = list(map(int, input().split()))

check = None
for i in a:
    if i%2==0:
        if i%3==0 or i%5==0:
            check = True
        else:
            check = False
            break
    else:
        check = False
    
if check:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
    # getting input on a variable 
aa = input()
a = list(map(int, input().split()))

check = None
for i in a:
    if i%2==0:
        if i%3==0 or i%5==0:
            check = True
        else:
            check = False
            break
    
if check:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
    # getting input on a variable 
aa = input()
a = list(map(int, input().split()))

check = None
for i in a:
    if i%2==0:
        if i%3==0 or i%5==0:
            check = True
        else:
            check = False
    
if check:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
    # getting input on a variable 
aa = input()
a = list(map(int, input().split()))

check = None
for i in a:
    if i%2==0:
        check = True
    else:
        check = False
        break
if check:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int, input().split()))
for i in range(N):
  if(A[i]%2==0):
    if((A[i]%3==0)or(A[i]%5==0)):
      continue
    else:
      print('DENIED')
      break
  if(i==N-1):
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
flag = True
for i in range(N):
    if i % 2 == 0 and (i % 3 == 0 or i % 5 == 0):
        continue
    else:
        flag = False

if flag:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(x)for x in input().split()]

A_even = [x for x in A if x%2 == 0]
ans = ""
for i in A_even:
    if i%3 == 0 or i%5 == 0:
        ans = 'APPROVED'
    else:
        ans = 'DENIED'
        break
print(ans)

Submission status: Wrong Answer

Solution code:
document = 25
if document % 2 == 0:
	if document % 3 == 0 or document % 5 == 0:
		print('approved')
	else:
		print('denied')
else:
	print('denied')

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
        
    for k in m:
        if k%2==0:
            l.append(k)

    if len(l)==0:
        print("DENIED")
        
    else:
        for p in l:
            if p%3==0 or p%5==0:
                a.append(p)
            else:
                b.append(p)

        if len(a)==len(l):
            print("APPROVED")
            
        else:
            print("DENIED")
    break

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    print(m)    
    for k in m:
        if k%2==0:
            l.append(k)

    if len(l)==0:
        print("DENIED")
        
    else:
        for p in l:
            if p%3==0 or p%5==0:
                a.append(p)
            else:
                b.append(p)

        if len(a)==len(l):
            print("APPROVED")
            
        else:
            print("DENIED")
    break

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)

    if len(l)==0:
        print("DENIDE")
        
    else:
        for p in l:
            if p%3==0 or p%5==0:
                a.append(p)
            else:
                b.append(p)

        if len(a)==len(l):
            print("APPROVED")
            
        else:
            print("DENIDE")
    break

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)

    if len(l)==0:
        print("DENIDE")
        break
    else:
        for p in l:
            if p%3==0 or p%5==0:
                a.append(p)
            else:
                b.append(p)

        if len(a)==len(l):
            print("APPROVED")
            
        else:
            print("DENIDE")
    break

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)

    if len(l)==0:
        print("DENIDE")
        break
    else:
        for p in l:
            if p%3==0 or p%5==0:
                a.append(p)
            else:
                b.append(p)

        if len(a)==len(l):
            print("APPROVED")
            break
        else:
            print("DENIDE")
            break

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)
    if len(l)==0:
        print("DENIDE")
        break
    
    for p in l:
        if p%3==0 or p%5==0:
            a.append(p)
        else:
            b.append(p)

    if len(a)==len(l):
        print("APPROVED")
        break
    else:
        print("DENIDE")
        break

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)
    if len(l)==0:
        print("DENIDE")
        break
    
    for p in l:
        if p%3==0 or p%5==0:
            a.append(p)
        else:
            b.append(p)

    if len(a)==len(l):
        print("APPROVED")
    else:
        print("DENIDE")
    break

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)
    
    for p in l:
        if p%3==0 or p%5==0:
            a.append(p)
        else:
            b.append(p)

    if len(a)==len(l):
        print("APPROVED")
    else:
        print("DENIDE")
    break

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
for i in range(len(A)):
  if i%2 == 0:
    if i%3 != 0 and i%5 != 0:
      A[i] = 0
if 0 in A:
  print('DENIED')
else:
  print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 'APPROVED'
for x in a:
    if not (x % 2 == 0 and (x % 3 == 0 or x % 5 == 0)) :
        ans = 'DENIED'
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 'DENIED'
for x in a:
    if x % 2 == 0 and x % 3 == 0 or x % 5 == 0 :
        ans = 'APPROVED'
    else:
        ans = 'DENIED'
        break
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 'DENIED'
for x in a:
    if x % 2 == 0 and x % 3 == 0 or x % 5 == 0 :
        ans = 'APPROVED'
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())


def read(): return list(map(int, input().split()))


data = read()
flag = True
for i in data:
    if (i % 2 == 0):
        if (i % 3 != 0 and i % 5 != 0):
            flag = False
            break
if (flag == True):
    print('APPROVED')
else:
    print('DEFINED')

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    sta = True
    A = [int(a) for a in input().split()]
    for i in range(N):
        if A[i] % 2 == 0:
            if A[i] % 3 != 0 and A[i] % 5 != 0:
                sta = False
    if sta:
        print("APPROVED")
    else:
        print("DENIES")
main()

Submission status: Wrong Answer

Solution code:
def nyu():
    N = int(input())
    A = list(map(int,input().split()))
    return N,A


def check(N,A):
    flg = True
    flg2 = False

    for n in range(N):
        if A[n] % 2 == 0:
            flg2 = True
            if A[n] % 3 != 0 and A[n] % 5 != 0:
                flg = False

    if flg == True and flg2 == True:
        print("APPROVED") 
    else :
        print("DENIED")
    



            

N,A = nyu()
check(N,A)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
flg = True
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            pass
    else:
        flg = False
        break

if flg:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = input()
nums = map(int, input())
print(nums)

Submission status: Wrong Answer

Solution code:
list_input_str = []
evenNumber = []
num = []
a = []

for i in range(2):
    s = input()
    if s:
        list_input_str.append(s)

if list_input_str:
    num = list_input_str[0]
    a = list_input_str[1].split(' ')

for i in range(int(num)):
    if int(a[i]) % 2 == 0:
        evenNumber.append(a[i])

if len(evenNumber) == 0:
    print('DENIED')
else:
    for i in range(len(evenNumber)):
        if not (int(evenNumber[i]) % 3 == 0 or int(evenNumber[i]) % 5 == 0):
            print('DENIED')
            break
        else:
            if i == int(len(evenNumber)) - 1:
                print('APPROVED')

Submission status: Wrong Answer

Solution code:
n=input()
a=list(map(int,input().split()))
for i in a:
    if i%2!=0:
        continue
    elif i%2==0:
        if i%3!=0 and i%5!=0:
            print('DENIED')
            break
    else:
        continue
print('APPROVED')

Submission status: Wrong Answer

Solution code:
N=input();ans=sum([ (a%2==0 and a%3*a%5 != 0) for a in map(int,input().split()) ])
print(('APPROVED','DENIED')[ans % 2])

Submission status: Wrong Answer

Solution code:
read = lambda: map(int, input().split())
n = int(input())
a = list(read())
print('APPROVED' if sum(i%3 and i%5 for i in a) ==0 else 'DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if not num%3 == 0 and num%5 == 0:
      print('DENIED')
      exit()
print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
judge = True
for i in a:
    if i%2 == 0:
        if i%3 != 0 and i%5 != 0:
            judge = False
            break

print('APPROVED') if judge else print('DENTED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%6 != 0 and num % 10 != 0:
    print('DENIED')
    exit()
print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = (int(x) for x in input().split())
for num in a:
  if num%6 != 0 and num % 10 != 0:
    print('DENIED')
    exit()
print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = input()
nums = list(map(int,input().split()))

for num in nums:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      break
print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
c = []
flag = False

for i in a:
    if i % 2 == 0:
        b.append(i)

for s in b:
    if s % 3 == 0 or s % 5 == 0:
        c.append(True)
    else:
        c.append(False)
for z in c:

    if not z:
        print("DENIED")
        break
    else:
        print("APPROVED")
        break

Submission status: Wrong Answer

Solution code:
n= int(input())
lista=[]
listanova=[]
for x in input().split():
	x= int(x)
	if x %2 ==0:
		lista.append(x)
for x in lista:
	if x %3==0 or x%5==0:
		listanova.append(x)

if len(lista)==len(listanova):
	print('APROVED')
else:
	print('DENIED')

Submission status: Wrong Answer

Solution code:
def f(a):
    for i in a:
        if i % 2 == 1:
            pass
        elif i % 2 == 0 and (i % 3 == 0 or i % 5 == 0):
            pass
        else:
            print('DENIED')
            break
    else:
        print('APPROVED')

a = list(map(int, input().split()))
f(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
  if i%2==0:
    if i%3!=0 and i%5!=0:
      print('DENIED')
      exit()
print('APPROVED')

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
li=[]
[li.append(a[i]) for i in range(n) if a[i]%2==0]

for x in range(len(li)):
    if li[x]%6!=0 or li[x]%10!=0:
        print("DENIED")
        break
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APROVED')
elif count != check:
	print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if (i%3 == 0 and i%5 != 0) or (i%3 != 0 and i%5 == 0):
            check += 1
if count == check:
	print('APROVED')
else:
	print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APROVED')
else:
	print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
        else:
            print('DENIED')
            break
if count == check:
	print('APROVED')

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
is_accept=True
evens=[i for i in a if i%2==0]
for i in range(len(evens)):
    if evens[i]%3!=0 and evens[i]%5!=0:
        is_accept=False
    break
print("APPROVED" if is_accept==True else "DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
for ele in A:
    if ele % 2 != 0:
        A.remove(ele)
for ele in A:
    if ele % 3 == 0 or ele % 5 == 0:
        count += 1
print("APPROVED" if count == len(A) else "DENIED")