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())
A=list(map(int,input().split()))
X=[]
count = 0
for i in range(N):
  if A[i]%2==0 and A[i]%3!=0  or A[i]%5!=0:
    count+=1
if count > 0:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 and a[i]%3!=0) or (a[i]%2==0 and a[i]%5!=0):
    print('DENIED')
    exit()
print('APPROVED')

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 and a[i]%3==0) or (a[i]%2==0 and a[i]%5==0):
    print('APPROVED')
    exit()
  else:
    print('DENIED')
    exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
s = list(map(int, input().split()))
e = [i for i in s if i % 2 == 0]
t = []
for i in e:
    t.append(i % 5)
k = []
for i in e:
    k.append(i % 3)
if t.count(0) >= 1 and k.count(0) >= 1:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
s = list(map(int, input().split()))
e = [i for i in s if i % 2 == 0]
t = []
for i in e:
    t.append(i % 5)
k = []
for i in e:
    k.append(i % 3)
if t.count(0) > 0 and k.count(0) > 0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
s = list(map(int, input().split()))
e = [i for i in s if i % 2 == 0]
t = []
for i in e:
    t.append(i % 5)
k = []
for i in e:
    k.append(i % 3)
if t.count(0) > 0 and k.count(0):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
s = list(map(int, input().split()))
even = [i for i in s if i % 2 == 0]
t = []
for i in s:
    t.append(i % 5)
k = []
for i in s:
    k.append(i % 3)

if 0 in t:
    print('APPROVED')
elif 0 in k:
    print('APPROVED')     
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
c = 0
b = 0
for i in range(len(a)):
  if i % 2 == 0:
    c += 1
  elif a[i] %2 == 0 and (a[i] % 3 != 0 or a[i] %5!= 0):
    b += 1
if c == b:
  print("APPROVED")
else:
  print("DENIED")

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 and (a[i] % 3 != 0 or a[i] %5!= 0):
    print("DENIED")
    break
  else:
    print("APPROVED")
    break

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 and a[i] % 3 != 0 and a[i] %5!= 0:
    print("DENIED")
    break
  else:
    print("APPROVED")
    break

Submission status: Wrong Answer

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

for i in range(N):
  if A[i]%2 == 0:
    if A[i]%3 == 0 or A[i]%5 == 0:
      res = True
    else:
      res = False
if res:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
_len = int(input())
nums = input().split(" ")

def isApprove(_len, nums):
  for i in range(_len):
    if int(nums[i]) % 2 == 0:
      if int(nums[i]) % 3 == 0 or int(nums[i]) % 5 == 0:
        return True
  
  return False

print('APPROVED' if isApprove(_len, nums) else 'DENIED')

Submission status: Wrong Answer

Solution code:
len=int(input())
list = input().split(" ")
msg="DENIED"
for i in range(len):
  if int(list[i])%2==0 and (int(list[i])%3==0 or int(list[i])%5==0):
    msg="APPROVED"
  elif int(list[i])%3==0 or int(list[i])%5==0:
    msg="APPROVED"
  else:
    msg="DENIED"
    break
  
print(msg)

Submission status: Wrong Answer

Solution code:
len=int(input())
list = input().split(" ")
msg="DENIED"
for i in range(len):
  if int(list[i])%2==0 and (int(list[i])==6 or int(list[i]) == 10):
    msg="APPROVED"
  elif int(list[i])%3==0 or int(list[i])%5==0:
    msg="APPROVED"
  else:
    msg="DENIED"
    break
  
print(msg)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
a1=input().split()
a2=[int(i) for i in a1]
empty=[]
for i in a2:
    if i%2!=0:
        a2.remove(i)
for i in a2:
    if i%3==0:
        empty.append(i)
        continue
    elif i%5==0:
        empty.append(i)
print('APPROVED' if len(empty)==len(a2) else 'DENIED')

Submission status: Wrong Answer

Solution code:
N=int(input())
a1=input().split()
a2=[int(i) for i in a1]
empty=[]
for i in a2:
    if i%2==1:
        a2.remove(i)
for i in a2:
    if i%3==0:
        empty.append(i)
    if i%5==0:
        empty.append(i)
print('APPROVED' if len(empty)==len(a2) else 'DENIED')

Submission status: Wrong Answer

Solution code:
N=int(input())
a1=input().split()
a2=[int(i) for i in a1]
empty=[]
for i in a2:
    if i%2==1:
        a2.remove(i)
for i in a2:
    if i%3==0 or i%5==0:
        empty.append(i)
print('APPROVED' if len(empty)==len(a2) else 'DENIED')

Submission status: Wrong Answer

Solution code:
N=int(input())
a1=input().split()
a2=[int(i) for i in a1]
empty=[]
for i in a2:
    if i%2==1:
        a2.remove(i)
for i in a2:
    if i%3==0 or i%5==0:
        empty.append(i)
print('APPROVED' if empty==a2 else 'DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
k = 0
for i in A:
  if i%2 == 1:
    A.remove(i)
for j in A:
  if j%3 != 0 and j%5 != 0:
    k = 1
    break
if k == 0:
  print('APPROVED')
elif k == 1:
  print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 'APPROVED'
for i in A:
    if i % 2 == 0:
        if i % 3 == 0:
            ans = 'APPROVED'
        if i % 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 = 'APPROVED'
for i in A:
    if i % 2 == 0:
        if i % 3 == 0:
            break
        if i % 5 == 0:
            break
        else:
            ans = 'DENIED'
print(ans)

Submission status: Wrong Answer

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

for i in range(n):
    if a[i] % 30 != 0:
        print('DENIED')
        exit()
print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
e=[i for i in a if i%2==0]
if e:
    for j in e:
        if j%3!=0 and j%5!=0:
            print('DENIED')
            break
    else:
        print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
e=[i for i in a if i%2==0]
if e:
    for j in e:
        if j%3==0 or j%5==0:
            continue
        else:
            print('DENIED')
            break
    else:
        print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
e=[i for i in a if i%2==0]
if e:
    for j in e:
        if j%3==0 or j%5==0:
            print('APPROVED')
            break
        else:
            print('DENIED')
            break
else:
    print('DENIED')

Submission status: Wrong Answer

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

flag =0
for i in A:
    if (i %2 ==1) or ((i%3)==0 or (i%5) == 0):
        pass
    else:
        flag =1

if flag== 1:
    print("DENIED")
else:
    print("APPROED")

Submission status: Wrong Answer

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

flg = 0
for i in A:
    if i % 2 == 0 and (i % 3 == 0 or i % 5 == 0) and flg != 2:
        flg = 1
    elif i % 2 == 0:
        flg = 2
      
if flg == 1:
    print('APPROVED')  
else:
    print('DENIED')

Submission status: Wrong Answer

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

flg = 0
for i in A:
    if i % 2 == 0 and (i % 3 == 0 or i % 5 == 0):
        flg  = 1
    elif i % 2 == 0 and (i % 3 != 0 and i % 5 != 0):
        print('DENIED')
        exit()
if flg == 1:
    print('APPROVED')  
else:
    print('DENIED')

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 and A[i] != 5:
      print("DENIED")
      exit()
    else:
      pass
  else:
    pass
  
print("APPROVED")

Submission status: Wrong Answer

Solution code:
import sys
n=int(input())
a=list(map(int,input().split()))
for i in a:
  if i%2==0:
    if i%3!=0 or i%5!=0:
      print("DENIED")
      sys.exit()

print("APPROVED")

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) | (a[i] % 5 == 0):
            print('DENIED')
            break
else:
    print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main() :
    input()
    a = map(int, input().split())
    for i in a :
        if i%2==0 and i%3 != 0 and i%5 != 0 :
            print("DENIED")
            return
            
        
    print("APROVED")
    

if __name__ == '__main__':
    import sys;
    try:
        main(sys.argv)
    except TypeError:
        main()

Submission status: Wrong Answer

Solution code:
def main() :
    input()
    a = map(int, input().split())
    for i in a :
        if i%2==0 and i%3 != 0 and i%3 != 0 :
            print("DENIED")
            return
            
        
    print("APROVED")
    

if __name__ == '__main__':
    import sys;
    try:
        main(sys.argv)
    except TypeError:
        main()

Submission status: Wrong Answer

Solution code:
def main() :
    input()
    a = map(int, input().split())
    for i in a :
        if i%3 != 0 and i%3 != 0 :
            print("DENIED")
            return
            
        
    print("APROVED")
    

if __name__ == '__main__':
    import sys;
    try:
        main(sys.argv)
    except TypeError:
        main()

Submission status: Wrong Answer

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

num = 0
for i in a:
  if i % 2 == 0 and (i % 3 != 0 and i % 5 != 0):
      num='DENIED'
      break
  else:
    num='APPROVE'
print(num)

Submission status: Wrong Answer

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

num = 0
for i in a:
  if i % 2 == 0:
    if i % 3 != 0:
      num='DENIED'
      break
    elif i % 5 != 0:
      num='DENIED'
      break
    else:
      num='APPROVED'
  else:
    num='DENIED'
print(num)

Submission status: Wrong Answer

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

num = 0
for i in a:
  if i % 2 == 0:
    if i % 3 != 0 or i % 5 != 0:
      num='DENIED'
    else:
      num='APPROVED'
  else:
    num='DENIED'
print(num)

Submission status: Wrong Answer

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

ans=0
for i in l:
  if i % 3 == 0 or i % 5 == 0:
    ans='APPROVED'
  else:
    ans='DENIED'
    break
print(ans)

Submission status: Wrong Answer

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

for i in l:
  if i % 3 == 0 and i % 5 == 0:
    print('APPROVED')
print('DENIED')

Submission status: Wrong Answer

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

    even = []

    for e in A:
        if e % 2 == 0:
            even.append(e)

    print(even)

    for e in even:
        if e % 3 != 0 and e % 5 != 0:
            print("DENIED")
            exit(0)

    print("APPROVED")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
lines = []
for i in range(2):
  inp = input()
  lines.append(inp)
searchList = []  
for i in range(int(lines[0])):
  split = lines[1].split()
  if int(split[i]) % 2 == 0:
    searchList.append(int(split[i]))
out = "APPROVED"
for s in searchList:
  if s % 3 != 0 and s % 5 != 0:
    out = "DENIED"
    print(out)
    break
print(out)

Submission status: Wrong Answer

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

f = True
for a in A_list:
  if a % 2 == 1:
    continue
  elif a % 3 == 0 or a % 5 == 0:
    continue
    
if f:
  print("ACCEPTED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
for i in A:
  if i%2==0:
    if i%3!=0 or i%5!=0:
      print("DENIED");exit()
print("APPROVED")

Submission status: Wrong Answer

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

list_a=[]
for i in a:
  if i%2==0:
    list_a.append(i)
if len(list_a)!=0:    
  if all([list_a[i]%3==0 or list_a[i]%5==0 for i in range(len(list_a))]):
    print('APPROVED')

  else:
    print('DENIED')
    
else:
  print('DENIED')

Submission status: Wrong Answer

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

list_a=[]
for i in a:
  if i%2==0:
    list_a.append(i)
if len(list_a)!=0:    
  if all([list_a[i]%3==0 or list_a[i]%5==0 for i in range(len(list_a)-1)]):
    print('APPROVED')

  else:
    print('DENIED')
    
else:
  print('DENIED')

Submission status: Wrong Answer

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

list_a=[]
for i in a:
  if i%2==0:
    list_a.append(i)
    
if all([list_a[i]%3==0 or list_a[i]%5==0 for i in range(len(list_a)-1)]):
  print('APPROVED')
  
else:
  print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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')
print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
l = map(int, input().split())
b = all([i%3==0 and i%5==0 for i in l if i%2 == 0])
print('APPROVED' if b else 'DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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")
    exit()
print("APPROVED")

Submission status: Wrong Answer

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

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:
            continue
        else:
            print('DENIED')
            exit()
print('APPROVED')

Submission status: Wrong Answer

Solution code:
n=int(input())
a=map(int,input().split())
for i in a:
    if i%2==0:
        if i%3!=0 or i%5!=0:
            result='DENIDE'
result='APROVED'
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A_even = [i for i in A if i % 2 == 0]
flag_list = list(map(lambda x: (x % 3 == 0) or (x % 5 == 0), A_even))
print(flag_list)
print('APPROVED' if False not in flag_list else 'DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A_even = [i for i in A if i % 2 == 0]
flag_list = list(map(lambda x: (x % 3 == 0) or (x % 5 == 0), A_even))
print(flag_list)
print('APPROVED' if False not in flag_list else 'DENIDE')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A_even = [i for i in A if i % 2 == 0]
flag_list = list(map(lambda x: (x % 3 == 0) or (x % 5 == 0), A_even))
print('APPROVED' if False not in flag_list else 'DENIDE')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = list(map(int, input().split()))
r = 'DENIED'
l = []
for num in num_list:
    if num % 2 == 0:
        l.append(num)
        if num % 3 == 0 or num % 5 ==0:
            l.remove(num)
            if len(l) == 0:
                r = 'APPROVED'
print(r)

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = list(map(int, input().split()))
r = 'DENIED'
for num in num_list:
    if num % 2 == 0:
        if num % 3 == 0 or num % 5 ==0:
            r = 'APPROVED'
print(r)

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 and a[i] % 3 != 0 and a[i] % 5 != 0:
        print('DENIED')
        break
print('APPROVED')

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:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n=int(input())
a=list(map(int,stdin.readline().split()))
poss=True
for i in a:
    if(i%2==0):
        if(i%3!=0 or i%5!=0):
            poss=False
            break
if(poss):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
import collections
elems = map(int, raw_input().split(' '))

def f(elems):
	for e in elems:
		if e % 2 == 0:
			if not((e % 3 == 0) or (e % 5 == 0)):
				return False
	return True

print 'Approved'.upper() if f(elems) else 'Denied'.upper()

Submission status: Wrong Answer

Solution code:
N=int(input())
flag=True
nums=list(map(int, input().split()))
for x in nums:
  if x%2:
    continue
  else:
    if x%3==0 and x%5==0:
      continue
    else:
      flag=False
      break
if flag:
  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 and a[i] // 5 != 0 :
            print("DENIED")

print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())

#リストにするとき
A_list = list(map(int,input().split()))

even = []
for i in A_list:
    if i%2==0:
        even.append(i)

judge=False   
for j in even:
    if j%3==0 or j%5==0:
        judge = True
    else:
        break

if judge==True:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(n-1):
    if l[i]%2==0:
        if l[i]%3!=0 and l[i]%5!=0:
            print("DENITED")
            c=1
            break
if c!=1:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(n):
    if l[i]%2==0:
        if l[i]%3!=0 and l[i]%5!=0:
            print("DENITED")
            c=1
            break
if c!=1:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = 0
for i in range(N):
  if A[i]%6 == 0 or A[i]%10 == 0:
    continue
  elif A[i]%2 == 1:
    continue
  else:
    B = 1
print('APPROVED' if B==0 else 'DNIED')

Submission status: Wrong Answer

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

num = [i for i in a if i % 2 == 0]
#print(num)
for i in num :
    if i % 3 == 0 or i % 5 == 0:
        print("APPROVED")
        exit()
    else:
        print("DENIED")
        exit()

Submission status: Wrong Answer

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

result = True


for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 != 0 or A[i] % 5 != 0:
            result = False
            break
            

if result == True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
input()
A=list(map(int,input().split()))
print("APPROVED" if all(a%2==0 and (a%3==0 or a%5==0) for a in A) else "DENIED")

Submission status: Wrong Answer

Solution code:
input()
A=list(map(int,input().split()))
print("APPROVED" if all(a%2==0 or a%3==0 or a%5==0 for a in A) else "DENIED")

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
A = [int(X) for X in input().split()]
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 5 == 0 or A[i]  % 3 ==0:
            print("APPROVED")
print("DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())

A=list(map(int,input().split()))

Alist = [x for x in A if x%2==0]

ans = False
for x in Alist:
    if x%3==0 or x%5==0:
        ans = True
    else:
        break
if ans == True:    
    print("APPROVED") 
else:
    print("DENIED")

Submission status: Wrong Answer

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

yoki = dame = d = 0

for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            yoki += 1
        else:
            dame += 1
    else :
        d += 1

if dame >= 1 or (yoki == 0 and d >= 1):
    print("DENIED")
elif yoki >= 1:
    print("APPROVED")

Submission status: Wrong Answer

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

yoki = dame = d = 0

for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            yoki += 1
        else:
            dame += 1
    else :
        d += 1

if dame >= 1 or yoki == 0 and d >= 1:
    print("DENIED")
elif yoki >= 1:
    print("APPROVED")

Submission status: Wrong Answer

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

yoki = dame = 0

for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            yoki += 1
        else:
            dame += 1

if dame >= 1:
    print("DENIED")
elif yoki >= 1:
    print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A = [a for a in A if a % 2 == 0]
print(A)

ans = "APPROVED"
for a in A:
    if (a % 3 != 0) and (a % 5 != 0):
        ans = "DENIED"
        break
print(ans)

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:
            print("APPROVED")
            exit()
        else:
            print("DENIED")
            exit()

print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
M=[]
for i in L:
  if i%2==0:
    M.append(i)
A='APPROVED'
for k in M:
  if k%3!=0 or k%5!=0:
    A='DENIED'
    break
print(A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    X = list(map(int, input().split()))
    for x in X:
        if x%2 != 0:
            continue
        elif x%3 != 0 and x%5 != 0:
            return "DENIED"
    return "APPROVED"

print(solve())

Submission status: Wrong Answer

Solution code:
N = int(input())
lis = list(map(int,input().split()))
result = "APPROVED"
for i in lis:
    if i %2 ==0:
        if i %3 !=0 or i%5 !=0:
            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 lis:
    if i %2 ==0:
        if i %3 ==0 or i%5 ==0:
            result = "APPROVED"
        else :
            result = "DENIED"
            break
print(result)