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 = list(map(int, input().split()))
c = 0

for i in range(N):
    if a_list[i]  % 2 != 0:
        a = 1
    else:
        if (a_list[i] % 3 != 0) and (a_list[i] % 5 != 0):
            c = 1
        else:
            a = 1


if c == 1:
    print("DENID")
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
n = int(input())
list = [int(x) for x in input().split(" ")]
result = 'DENIED'
for i in range(len(list)):
    if list[i]%2 != 0:continue
    else:
        if list[i]%3==0 or list[i]%5==0:
            result = 'APPROVED'
        else:
            result = 'DENIED'
print(result)

Submission status: Wrong Answer

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

for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 or a[i] % 5 != 0:
            print("DENIED")
            sys.exit()

print("APPROVED")

Submission status: Wrong Answer

Solution code:
A = input()
B = input()
arr1 = [int(i) for i in B.split(' ')]
arr2 = []
output = ''
for i in range(len(arr1)):
	if((arr1[i]%2)==0):
		arr2.append(arr1[i])
for j in range(len(arr2)):
	l = int(arr2[j]/3)
	k = int(arr2[j]/5)
	if(((l%2)==0)or((k%2)==0)):
		output = 'APPROVED'
	else:
		output = 'DENIED'
		break
print(output)

Submission status: Wrong Answer

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

if len(tmp) == 0:
    print('DENIED')

for i in tmp:
    if i % 3 == 0 or i % 5 == 0:
        continue
    else:
        print('DENIED')
        exit()

print('APPROVED')

Submission status: Wrong Answer

Solution code:
N=int(input())

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

c=0

for i in s:
  if i%2==0:
    if i%3==0 or i%5==0:
      c=1
      break
    
if c==1:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
n = input()
m = input().split()
judge = ""
for i, e in enumerate(m):
    if int(e)%2 == 0:
        if int(e)%3==0 or int(e)%5==0:
            judge = "APPROVED"
        else:
            judge = "DENIED"
            break
print(judge)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
b = input().split()
b = list(map(int, b))
c = 0
for i in b:
    if i%3 != 0:
        if i%5 != 0:
            print("DENIED")
            break
    
    c +=1
if c == a:
    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 i % 3==0 or i %5 ==0:

            print("APPROVED")

        else:
             print("DENIED")
        exit()

Submission status: Wrong Answer

Solution code:
A = input()
B = input()
arr1 = [int(i) for i in B.split(' ')]
arr2 = []
output = ''
for i in range(len(arr1)):
	if((arr1[i]%2)==0):
		arr2.append(arr1[i])
print(arr2)
for j in range(len(arr2)):
	l = int(arr2[j]/3)
	k = int(arr2[j]/5)
	print(l%2)
	print(k%2)
	if(((l%2)==0)or((k%2)==0)):
		output = 'APPROVED'
	else:
		output = 'DENIED'
		break
print(output)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(int(x) for x in input().split())
a = []
for i in l:
    if i % 2 == 0:
        a.append(i)
x = [i % 3 == 0 or i % 5 == 0 for i in a]
print(x,a,l)
if len(a) == sum(x):
    print('APPROVED')
elif len(a) == 0:
    print('DENIED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ais = list(map(int, input().split()))
evens = []
for a in ais:
  if a % 2 == 0:
    evens.append(a)
if len(evens) == 0:
  print("DENIED")
  quit()
m = 0
for e in evens:
  if e % 3 == 0 or e % 5 == 0:
    pass
  else:
    m += 1
if m == 0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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



def check():
    if len(A) <= N:
        for i in A:
            if i % 2 == 0:
                if i % 5 == 0 or i % 3 == 0:
                    return True
                elif i % 5 == 0 and i % 3 == 0:
                    return True    
                else:
                    return False 
            else:
                return False

                
validation =  check()

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

Submission status: Wrong Answer

Solution code:
N=int(input())
a = list(map(int,input().split()))
c=0
i=0
print(a)
while(c==0 and i<N):
    if(a[i]%2==0):
        if(a[i]%3==0 or a[i]%5==0):
            i+=1
        else:
            c+=1
    else:
        i+=1
if(c==1):
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

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

a = list()


for i in range(N):
    if (c[i] % 2 == 0):
        if(c[i] % 3 == 0 or c[i] % 5 == 0):
            a.append(1)
        else:
            a.append(0)

b = 0
for i in range(len(a)):
    b = b + int(a[0])

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

Submission status: Wrong Answer

Solution code:
N = input()
raw_input1 = input()

l = raw_input1.split()
l_num = [int(x) for x in l]

flag = 0
flag1 = 0

for a in l_num:
    if a % 2 ==0:
        print(a)
        if a % 3 == 0 or a % 5 == 0:
            flag = 0
        else:
            flag = 1
    if flag != 0:
        break

if flag == 0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A_N = list(map(int, input().split()))
A_N_even = []

for i in A_N:
    if i % 2 == 0:
        A_N_even.append(i)

ans = "DENIED"
for i in A_N_even:
    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 = list(map(int,input().split()))
flg = 0

for i in range(0,N):
    if A[N-1] % 2 == 0:
        if A[N-1] % 3 != 0 or A[N-1] % 5 != 0 :
            flg = 1

if flg == 0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

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



def check():
    if len(A) <= N:
        for i in A:
            if i % 2 == 0:
                if i % 5 == 0 or i % 3 == 0:
                    return True
                elif i % 5 == 0 and i % 3 == 0:
                    return True     
            else:
                return False

                
validation =  check()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

a = [int(i) for i in input().split()]

x=[]
j=0
for i in range(N):
  if a[i] %2 ==0:
    x.append(a[i])
    j +=1
    
for i in range(j):
  if x[i] %3 ==0 or x[i] %5 ==0:
    print("APPROVED")
  else:
    print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(int(x) for x in input().split())
a = []
for i in l:
    if i % 2 != 0:
        a.append(i)
if len(a) == sum([i % 3 == 0 or i % 5 == 0 for i in a]):
    print('APPROVED')
elif len(a) == 0:
    print('DENIED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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



def check():
    if len(A) > N:
        for i in A:
            if i % 2 == 0:
                if i % 5 == 0 or i % 3 == 0:
                    return True
                else:
                    return False
            else:
                return False
    else:
        return False
                
                
validation =  check()

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

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

n = int(input())
aList = input().split(" ")

aList = np.array(aList, dtype=np.int)
aList = aList[aList % 2 == 0]

a = list(aList[aList % 5 == 0])
b = list(aList[aList % 3 == 0])

if len(aList) == len(set(a + b)):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())
s = map(int, input().split())
lis = [6, 10, 12, 18, 20, 24, 30, 36, 40, 42, 48, 50, 54, 60, 66, 70, 72, 78, 80, 84, 90, 96, 100, 102, 108, 110, 114, 120, 126, 130, 132, 138, 140, 144, 150, 156, 160, 162, 168, 170, 174, 180, 186, 190, 192, 198, 200, 204, 210, 216, 220, 222, 228, 230, 234, 240, 246, 250, 252, 258, 260, 264, 270, 276, 280, 282, 288, 290, 294, 300, 306, 310, 312, 318, 320, 324, 330, 336, 340, 342, 348, 350, 354, 360, 366, 370, 372, 378, 380, 384, 390, 396, 400, 402, 408, 410, 414, 420, 426, 430, 432, 438, 440, 444, 450, 456, 460, 462, 468, 470, 474, 480, 486, 490, 492, 498, 500, 504, 510, 516, 520, 522, 528, 530, 534, 540, 546, 550, 552, 558, 560, 564, 570, 576, 580, 582, 588, 590, 594, 600, 606, 610, 612, 618, 620, 624, 630, 636, 640, 642, 648, 650, 654, 660,666, 670, 672, 678, 680, 684, 690, 696, 700, 702, 708, 710, 714, 720, 726, 730, 732, 738, 740, 744, 750, 756, 760, 762, 768, 770, 774, 780, 786, 790, 792, 798, 800, 804, 810, 816, 820, 822, 828, 830, 834, 840, 846, 850, 852, 858, 860, 864, 870, 876, 880, 882, 888, 890, 894, 900, 906, 910, 912, 918, 920, 924, 930, 936, 940, 942, 948, 950, 954, 960, 966, 970, 972, 978, 980, 984, 990, 996]
tmp = 0
lis2 = []
for i in range(n):
    if i % 2 == 0:
        lis2.append(i)
for i in s:
    if i in lis:
        tmp += 1
if len(lis2) == tmp:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
def judge(N, A):
  cnt = 0
  odd = 0
  for i in range(N):
    if A[i] % 2 != 0:
      odd += 1
      continue
    else:
      if (A[i] % 3 == 0) or (A[i] % 5 == 0):
        cnt += 1
  even = N - odd
  if cnt == even:
    print('APROVED')
  else:
    print('DENIED')
    
N = int(input())
A = list(map(int, input().split()))
judge(N, A)

Submission status: Wrong Answer

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



def check():
    if len(A) <= N:
        for i in A:
            if i % 2 == 0:
                if i % 5 == 0 or i % 3 == 0:
                    return True
                else:
                    return False
            else:
                return False
    else:
        return False
                
                
validation =  check()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))

n = input1[0]

for a in input2:
    if(a & 1 == 1):
        continue

    if(a % 3 == 0 or a % 5 == 0):
        print("APPROVED")
        exit(0)

print("DENIED")

Submission status: Wrong Answer

Solution code:
i = int(input())
i2 = list(map(int, input().split()))
    
new_list = []
for i in range(i):
  if i2[i] % 2 == 0:
    if i2[i] % 3 == 0 or i2[i] % 5 == 0:
        new_list.append('APPROVED')
    else:
        new_list.append('DENEID')
    break
    
if (all(str == 'APPROVED' for str in new_list)):
	print('APPROVED')
else:
  	print('DENIED')

Submission status: Wrong Answer

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

l = [i for i in a if i%2 == 0]

ans =  [i for i in l if i%3 == 0]
ans +=  [i for i in l if i%5 == 0]

if ans == l:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n =int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if not A:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = input()
raw_input1 = input()

l = raw_input1.split()
l_num = [int(x) for x in l]

flag = 0
flag1 = 0

for a in l_num:
    if a % 2 ==0:
        if a % 3 == 0 or a % 5 == 0:
            flag = 0
        else:
            flag = 1
    if flag != 0:
        break

if flag == 0:
    print('APPROVAL')
else:
    print('DENIED')

Submission status: Wrong Answer

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

for i in A:
    if i% 6 ==0 or i % 10 ==0:
        print("APPROVED")

    else:
        print("DENIED")
    exit()

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:
    #print(i)
    #print(i%3, i%5)
    if i%3==0 or i%5==0:
      ans = 'APPROVED'
    else:
      ans = 'DENIED'
      break

print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# 入力
n = int(input())
An_list = list(map(int, input().split()))

# 拒否フラグ
deny_flag = False

# 数が合わないときは拒否？
if n != len(An_list):
    print("DENIED")
    exit()


# 入国条件処理
for Ai in An_list:
    if Ai % 2 == 0:
        if (Ai%3 == 0) or (Ai%5 == 0):
            # 入国条件に合うので継続
            pass
        else:
            # 入国条件に合わないので拒否して終了
            print("DENIED")
            deny_flag = True


# 数値をすべて審査してdeny_flagがFalseなら承認
if not deny_flag:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = []
A = input().split()
ans = 0

for i in range(N-1):
    if(int(A[i])%2 == 0):
        if(int(A[i])%3 == 0 or int(A[i])%5 == 0):
            ans = 1
        else:
            ans = -1
    else:
        continue

if(ans == 1):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))

n = input1[0]

for a in input2:
    if(a & 1 == 1):
        print("DENIED")
        exit(0)

    if(a % 3 == 0 or a % 5 == 0):
        print("APPROVED")
        exit(0)

print("DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(int(i) for i in input().split())

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

Submission status: Wrong Answer

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



def check():
    if len(A) <= N:
        for i in A:
            if i % 2 == 0:
                if i % 5 == 0 or i % 3 == 0:
                    return True
                else:
                    return False
                
                
validation =  check()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
line1 = input('')
line2 = input('') 
result = True
list = []
list.extend(line1.split(' '))
list.extend(line2.split(' '))
for no_str in list:
  no = int(no_str)
  if no % 2 == 0:
    if no %3 != 0 or no % 5 != 0:
      result = False

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

Submission status: Wrong Answer

Solution code:
n =int(input())

A = [0 for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if not A:
    print("DENIED")
else:
    print("APPROVED")

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

Submission status: Wrong Answer

Solution code:
a = 3
b = [1,2,3]
x = 0

if (a==0) :
	print('DENIED')
elif (b.count(0) > 0):
	print('DENIED')
else:
  for i in b:
      if i % a == 0:
          x += 1
  if x == len(b):
      print('APPROVED')
  else:
      print('DENIED')

Submission status: Wrong Answer

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



def check():
    if len(A) <= N:
        for i in A:
            if i % 2 == 0:
                if i % 5 == 0 or i % 3 == 0:
                    return True
                else:
                    return False
            else:
                return False
                
                
validation =  check()

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

Submission status: Wrong Answer

Solution code:
n =int(input())
s = map(int, input().split())
lis = [6, 10, 12, 18, 20, 24, 30, 36, 40, 42, 48, 50, 54, 60, 66, 70, 72, 78, 80, 84, 90, 96, 100, 102, 108, 110, 114, 120, 126, 130, 132, 138, 140, 144, 150, 156, 160, 162, 168, 170, 174, 180, 186, 190, 192, 198, 200, 204, 210, 216, 220, 222, 228, 230, 234, 240, 246, 250, 252, 258, 260, 264, 270, 276, 280, 282, 288, 290, 294, 300, 306, 310, 312, 318, 320, 324, 330, 336, 340, 342, 348, 350, 354, 360, 366, 370, 372, 378, 380, 384, 390, 396, 400, 402, 408, 410, 414, 420, 426, 430, 432, 438, 440, 444, 450, 456, 460, 462, 468, 470, 474, 480, 486, 490, 492, 498, 500, 504, 510, 516, 520, 522, 528, 530, 534, 540, 546, 550, 552, 558, 560, 564, 570, 576, 580, 582, 588, 590, 594, 600, 606, 610, 612, 618, 620, 624, 630, 636, 640, 642, 648, 650, 654, 660,666, 670, 672, 678, 680, 684, 690, 696, 700, 702, 708, 710, 714, 720, 726, 730, 732, 738, 740, 744, 750, 756, 760, 762, 768, 770, 774, 780, 786, 790, 792, 798, 800, 804, 810, 816, 820, 822, 828, 830, 834, 840, 846, 850, 852, 858, 860, 864, 870, 876, 880, 882, 888, 890, 894, 900, 906, 910, 912, 918, 920, 924, 930, 936, 940, 942, 948, 950, 954, 960, 966, 970, 972, 978, 980, 984, 990, 996]
for i in s:
    if i not in lis:
        print('DENIED')
        exit()
print('APPROVED')

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
list = [int(x) for x in input().split(" ")]
result = 'DENIED'
for i in range(len(list)):
    if list[i]%2 != 0:continue
    elif list[i]%3!=0 and list[i]%5!=0:break

    else:
        result = 'APPROVED'
print(result)

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:
      ans = 'DENIED'
      break
    
print(ans)

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:
            ans="DENIED"
            break
    else:
        continue
        
print(ans)

Submission status: Wrong Answer

Solution code:
s = map(int, input().split())
lis = [6, 10, 12, 18, 20, 24, 30, 36, 40, 42, 48, 50, 54, 60, 66, 70, 72, 78, 80, 84, 90, 96, 100, 102, 108, 110, 114, 120, 126, 130, 132, 138, 140, 144, 150, 156, 160, 162, 168, 170, 174, 180, 186, 190, 192, 198, 200, 204, 210, 216, 220, 222, 228, 230, 234, 240, 246, 250, 252, 258, 260, 264, 270, 276, 280, 282, 288, 290, 294, 300, 306, 310, 312, 318, 320, 324, 330, 336, 340, 342, 348, 350, 354, 360, 366, 370, 372, 378, 380, 384, 390, 396, 400, 402, 408, 410, 414, 420, 426, 430, 432, 438, 440, 444, 450, 456, 460, 462, 468, 470, 474, 480, 486, 490, 492, 498, 500, 504, 510, 516, 520, 522, 528, 530, 534, 540, 546, 550, 552, 558, 560, 564, 570, 576, 580, 582, 588, 590, 594, 600, 606, 610, 612, 618, 620, 624, 630, 636, 640, 642, 648, 650, 654, 660,666, 670, 672, 678, 680, 684, 690, 696, 700, 702, 708, 710, 714, 720, 726, 730, 732, 738, 740, 744, 750, 756, 760, 762, 768, 770, 774, 780, 786, 790, 792, 798, 800, 804, 810, 816, 820, 822, 828, 830, 834, 840, 846, 850, 852, 858, 860, 864, 870, 876, 880, 882, 888, 890, 894, 900, 906, 910, 912, 918, 920, 924, 930, 936, 940, 942, 948, 950, 954, 960, 966, 970, 972, 978, 980, 984, 990, 996]
for i in s:
    if i not in lis:
        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 and a[i]%5 != 0:
            print("DENIED")
            break
    elif i == n-1:
        print("APPROVED")
        break

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int, input().split()))
br=0
p=0
for i in range (n):
    if l[i]%2==0:
        p+=1
        if l[i]%5==0 or l[i]%3==0:
            br+=1
   
if br==p:
    print("APPROVED")
else:
    print("DENITED")

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(int(x) for x in input().split())
a = []
for i in l:
    if i % 2 == 0:
        a.append(i)
print(l)
if len(a) == sum([i % 3 == 0 or i % 5 == 0 for i in a]):
    print('APPROVED')
elif len(a) == 0:
    print('DENIED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
import numpy as np
N = input()
list = list(map(int,input().split(' ')))

list = np.array(list)
A = list[list%2 == 0]
B = np.unique(np.append(list[list%6 == 0],(list[list%10 == 0])))

if len(A) ==0:
        print('APPROVED')
elif len(B) ==0:
    print('DENIED')
else:
    if len(A) == len(B) :
        print('APPROVED')
    else:
        print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
*A, = map(int, input().split())
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0
for l in B:
  if l % 3 == 1 or l % 5 == 0:
    C += C + 1
  else:
    C += C + 2
if C/N ==1:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

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

a_list_even = [i for i in a_list if i % 2 == 0]
print(a_list_even)
for a in a_list_even:
    if a % 3 == 0 or a % 5 == 0:
        continue
    else:
        print("DENIED")
        exit()

print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N = input()
list = list(map(int,input().split(' ')))

list = np.array(list)
A = list[list%2 == 0]
B = np.unique(np.append(list[list%6 == 0],(list[list%10 == 0])))

if len(B) ==0:
    print('DENIED')
else:
    if len(A) == len(B) :
        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:
    if a[i]%15!=0:
      ans="DENIED"
    else:
      ans="APPROVED"
    
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,(input().split())))
ans = ''
for i in a:
  if i%2==0:
    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())
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0
for l in B:
  if l % 3 == 1 or l % 5 == 0:
    C += C + 1
  else:
    C += C + 2
if C/N ==1:
  print('APPR0VED')
else:
  print('DENIED')

Submission status: Wrong Answer

Solution code:
#coding utf-8

def main():
    question_b()

def question_b():
    n = int(input())
    syorui = list(map(int,input().split()))
    flg = False
    oddflg = False
    box = []
    for i in range(n):
        if syorui[i]%2 == 0:
            oddflg = True
            if syorui[i]%3 == 0 or syorui[i]%5 == 0:
                flg = True
            else:
                break
    if flg == True or oddflg == False:
        print("APPROVED")
    else:
        print("DENIED")

main()

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")

    else:
        print("DENIED")
    exit()

Submission status: Wrong Answer

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

a = list()


for i in range(N):
    if (c[i] % 2 == 0):
        if(c[i] % 3 == 0 or c[i] % 5 == 0):
            a.append("a")
        else:
            a.append("b")


if(len(set(a)) == 1):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
n =int(input())
A = [0 if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 
     else 1 for x in input().split()]
for i in A:
    if i == 0:
        print("APPROVED")
    else:
        print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
c = 0
for i in range(N):
    if a_list[i] % 2 == 0:
        if a_list[i] % 3 == 0:
            a = 1
        elif a_list[i] % 5 == 0:
            a = 1
        else:
            c = 1
    else:
        a = 1
    

if c == 1:
    print("DENID")
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
cnt=0
while True:
    if cnt>=n:
        print('DENIED')
        break
        
    elif a[cnt]%2==0:
        if a[cnt]%3==0 or a[cnt]%5==0:
            cnt+=1
            continue
        else:
            print('DENIED')
            break
    elif cnt==n:
        print('APPROVED')
        break
    else:
        cnt+=1
        continue

Submission status: Wrong Answer

Solution code:
import numpy as np
N = input()
list = list(map(int,input().split(' ')))

list = np.array(list)
A = list[list%2 == 0]
B = np.unique(np.append(list[list%6 == 0],(list[list%10 == 0])))

if len(A) == len(B) :
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = input()
x = [int(x) for x in input().split()]
even_nos = [num for num in x if num % 2 == 0]
m = 'DENIED'
for s in even_nos:
    if s % 3 == 0:
        m = 'APPROVED'
    elif s % 5 == 0:
        m = 'APPROVED'
    else:
        m = 'DENIED'
        break
print(m)

Submission status: Wrong Answer

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

count = 0
for i in A:
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      count += 1
  else:
    break

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