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

lst_0 = [e for e in a if e % 2 == 0]
lst_1 = [e for e in lst_0 if e % 3 == 0]
lst_2 = [e for e in lst_0 if e % 5 == 0]
lst_3 = lst_1 + lst_2

if lst_3 == lst_0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
a = int(input())
b = map(int,input().split())
c = 0
d = 0
for i in b:
  if i%2==0:
    c=c+1
    if i%a==0:
      d=d+1
if c==d:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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



def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    else:
        return False   
        
B = []
C = False
count = 0

for i in A :
    if i % 2 == 0:
        validation =  check(i)
        B.append(validation)
    else:
      count = count + 1
if count == len(A):
    print("DENIED")
else:

    for i in B:
        if i == False:
            C = False
            break
        else:
            C = True


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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a = int(input())
lis = list(map(int, input().split()))
for i in range(a):
  judge = True
  if (lis[i] % 2 == 0):
    if (lis[i] % 3 != 0) and (lis[i] % 5 != 0):
      judge = False
# 出力
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
a = int(input())
 
b=list(map(int, input().split())) 
x = 0
c = 0

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

  for t in b:
    if (t%2==0):
      c += 1;

          
  if x == c:
    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):
    ai=A[i]
    if ai%2==0:
        ans.append(str(ai))
    else:
        continue

if ans==[]:
    print('DENIED')
    exit()

for i in range(len(ans)):
    a = int(ans[i])
    if a%3==0:
        continue
    elif a%5==0:
        continue
    else:
        print('DENIED')
        exit()
print('APPROVED')

Submission status: Wrong Answer

Solution code:
import sys
input_first = input().split()
input_second = input().split()

N= input_first
paper = [int(i) for i in input_second]

guusuu = 0
flag  =0
for num in paper:
    if num %2 == 0:
        guusuu =1
        if  num % 5  == 0 or num % 3 == 0:
            # print('APPROVED')
            # sys.exit(0)
            pass
        else:
            # print('DENIED')
            # sys.exit(0)
            flag = 1

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

Submission status: Wrong Answer

Solution code:
n = input()
data = [int(str) for str in input().split() if int(str)%2 ==0]
for i in data:
  if i%3 != 0 and i%5 != 0:
    print("DENIED")
    break
  else:
    print("APPROVED")
    break

Submission status: Wrong Answer

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



def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    else:
        return False   
        
B = []
C = False

for i in A :
    if i % 2 == 0:
        validation =  check(i)
        B.append(validation)

for i in B:
    if i == False:
       C = False
       break
    else:
       C = True


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

Submission status: Wrong Answer

Solution code:
N=int(input())
List=list(map(int,input().split()))
nList=[e for e in List if e % 2 == 0]
for f in nList:
  if f % 3 == 0 or f % 5 == 0:
    print("APPROVED")
  else:
    print("DENIED")
    break

Submission status: Wrong Answer

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

count = 0
odd = 0
flag = 0
for n in A:
    count += 1
    if (n % 2) == 0:
        flag = 1
        if (n % 3) == 0 or (n % 5) == 0:
            odd += 1
        else:
            print("DENIED")
            exit()

if count == len(A) and flag==0:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(input().split())
ln=[]
m=0
for i in l:
  if int(i)%2==0:
    ln.append(int(i))
for k in ln:
  if k%3==0 or k%5==0:
    m=m+1
if m==len(ln):
  print("APPROVED")
else:
  print("DENYED")

Submission status: Wrong Answer

Solution code:
a = int(input())
 
b=list(map(int, input().split())) 
x = 0
c = 0

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

Submission status: Wrong Answer

Solution code:
def fun(li):
  for i in li:
    if i%2 == 0:
      if i%3 == 0 or i%5 ==0:
        continue;
      else:
        return "DENIED"
    return "APPROVED"
n = int(input())
li = [int(num) for num in input().split(" ")]
print(fun(li))

Submission status: Wrong Answer

Solution code:
a = int(input())
b = map(int,input().split())
c = []
d = 0
for i in b:
  if i%2==0:
    c.append(i)
for j in c:
  if j%a==0:
    d+=1
if d == len(c):
  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]
tmp = [i for i in a if i%2 == 0]

while l:
    e = l.pop()
    if e % 2 == 0:
        tmp.append(e)

while tmp:
    l.append(tmp.pop())

while tmp:
    e = tmp.pop()
    if e % 3 == 0:
        l.append(e)

while l:
    tmp.append(l.pop())

while tmp:
    e = tmp.pop()
    if e % 5 == 0:
        l.append(e)

while l:
    tmp.append(l.pop())


if tmp != l:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

count = 0
odd = 0

for n in A:
    count += 1
    if (n % 2) == 0:
        if (n % 3) == 0 or (n % 5) == 0:
            odd += 1
        else:
            print("DENIED")
            exit()

if count == len(A):
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

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



def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    else:
        return False   
        
            

                
B = []

for i in A :
    if i % 2 == 0:
        validation =  check(i)
        B.append(validation)
   
for i in B:
    if i == False or i == None:
       print("DENIED")   
       break
    else:
        print("APPROVED")
        break

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int,input().split()))
    a = []
    for g in range(N):
        d = A[g]
        D = d % 2
        if D == 0 :
            a.append(d)
    _a = len(a)
    for X in range(_a) :
        x = a[X]
        n = x //10
        if n < 1:
            K = x % 3
            if K == 0 or x ==5 or x == 0 :
              print('APPROVED')  
              
            else:
                print('DENIED')
        elif n >= 1 :
            s = str(x)
            h = int(s[-1])
            H = int(s[-2])
            S = h + H
            k = S % 3
            if k == 0 or h ==5 or h == 0 :
                print('APPROVED')
            else:
                print('DENIED')
resolve()

Submission status: Wrong Answer

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



def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    elif i % 5 == 0 and i % 3 == 0:
        return True    
    else:
        return False   
        
            

                
B = []

for i in A :
    if i % 2 == 0:
        validation =  check(i)
        B.append(validation)
   
for i in B:
    if i == False or i == None:
       print("DENIED")   
       break
    else:
        print("APPROVED")
        break

Submission status: Wrong Answer

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

approved = True

for i in integers[0:N]:
    if i%2==0:
        gusus.append(i)

for i in gusus:
    if i%3==0 or i%5==0:
        pass
    else:
        approved=False
        break

if len(gusus)==0:
    approved=False

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

Submission status: Wrong Answer

Solution code:
a = int(input())
 
b=list(map(int, input().split())) 
x = 0
 
if (a==0) :
	print('DENIED')
elif (b.count(0) > 0):
	print('DENIED')
else:
  for i in b:
      if (i % a == 0) and (i % 2 == 0):
          x += 1
if x == len(b):
  print('APPROVED')
else :
  print('DENIED')

Submission status: Wrong Answer

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

if 'DENEID' in l:
  	print('DENEID')
else:
  	print('APPROVED')

Submission status: Wrong Answer

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



def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    elif i % 5 == 0 and i % 3 == 0:
        return True    
    else:
        return False   
        
            

                
B = []

for i in A :
    validation =  check(i)
    if i % 2 == 0:
        B.append(validation)
   
for i in B:
    if i == False or None:
       print("DENIED")   
       break
    else:
        print("APPROVED")
        break

Submission status: Wrong Answer

Solution code:
a = int(input())
 
b=list(map(int, input().split())) 
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:
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])

aList = list(aList)

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

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
li = list(map(int, input().split()))

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

print("PASS")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []
wk = wk1 = 0

for i in range(n):
    if a[i]%2 == 0:
        b.append(a[i])

for j in range(len(b)):
    if b[j]%3 == 0 or b[j]%5 == 0:
        wk1 = 1
    else:
        wk1 = 0
if wk1 == 0:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
odd = 0

for n in A:
    count += 1
    if (n % 2) == 0:
        count += 1
        if (n % 3) == 0 or (n % 5) == 0:
            odd += 1
        else:
            print("DENIED")
            exit()

if count == len(A):
    print("DENIED")
else:
    print("APPROVED")

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) > 0:
    if len(aList) == len(set(a + b)):
        print("APPROVED")
    else:
        print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
a = int(input())
 
b=list(map(int, input().split())) 
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:
i1 = int(input())
i2 = list(map(int, input().split()))
    
l = []
for i in range(i1):
  if i2[i] % 2 == 0:
    if i2[i] % 3 == 0 or i2[i] % 5 == 0:
        l.append('APPROVED')
    elif i2[i] % 3 != 0 and i2[i] % 5 != 0:
        l.append('DENEID')

if 'DENEID' in l:
  	print('DENEID')
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:
        if list[i]%3==0 or list[i]%5==0:
            result = 'APPROVED'
        else:
            result = 'DENIED'
            break
print(result)

Submission status: Wrong Answer

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



def check(i):
    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   
            

                
B = []

for i in A :
    validation =  check(i)
    B.append(validation)
   
for i in B:
    if i == False or None:
       print("DENIED")   
       break

print("APPROVED")

Submission status: Wrong Answer

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

x=0
for i in A:
  print(i)
  if i%2==0:
    if not i%3==0 and not i%5==0:
      print("DENIED")
      x=1
      break
    else:
      continue
    
  else:
   	continue
  break
if x ==0:
	print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
 
b=list(map(int, input().split())) 
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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
length = int(input())
li = list(map(int,input().split()))

judge = True

for i in range(length):
  a = li[i]
  if a % 2 == 0:
      if a % 3 != 0 or a % 5 != 0:
          judge = False
          break;
  
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
import sys
input_first = input().split()
input_second = input().split()

N= input_first
paper = [int(i) for i in input_second]


for num in paper:
    if num %2 == 0:
        if  num % 5  == 0 or num % 3 == 0:
            print('APPROVED')
            sys.exit(0)
        else:
            print('DENIED')
            sys.exit(0)


print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int,input().split()))
    a = []
    for g in range(N):
        d = A[g]
        D = d % 2
        if D == 0 :
            a.append(d)
    _a = len(a)
    for X in range(_a) :
        x = a[X]
        n = x //10
        if n < 1:
            K = x % 3
            if K == 0 or x ==5 or x == 0 :
                print('APPROVED')
            else:
                print('DENIED')
        elif n >= 1 :
            s = str(x)
            h = int(s[-1])
            H = int(s[-2])
            S = h + H
            k = S % 3
            if k == 0 or h ==5 or h == 0 :
                print('APPROVED')
            else:
                print('DENIED')
resolve()

Submission status: Wrong Answer

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

count = 0
odd = 0
flag = 0

for n in A:
    if (n % 2) == 0:
        count += 1
        #print(n)
        if (n % 3) == 0 or (n % 5) == 0:
            odd += 1
        else:
            print("DENIED")
            exit()

if count == 0:
    print("DENIED")
elif count == odd:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
x=0
for i in A:
  if i%2==0:
    if not i%3==0 and not i%5==0:
      print("DENIED")
      x=1
      break
    
  else:
   	continue
  break
if x ==0:
	print("APPROVED")

Submission status: Wrong Answer

Solution code:
length = int(input())
li = list(map(int,input().split()))

judge = True

for i in range(length):
  a = li[i]
  if a % 2 == 0:
      if not a % 3 == 0 or a % 5 == 0:
          judge = False
          break;
  
if judge:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
i = int(input())
i2 = list(map(int, input().split()))
    
l = []
for i in range(i):
  if i2[i] % 2 == 0:
    if i2[i] % 3 == 0 or i2[i] % 5 == 0:
        l.append('APPROVED')
    elif i2[i] % 3 != 0 and i2[i] % 5 != 0:
        l.append('DENEID')

if 'DENEID' in l:
  	print('DENEID')
else:
  	print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

flag = 0
for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 == 0 or a[i]%5 == 0:
            flag += 1
        else:
            flag = 0
            break

if flag != 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
num = int(input())
input_line = input().split(' ')
immigration_num = [int(i) for i in input_line]

immigration = True;
count = 0
for i in immigration_num:
  if(i % 2 == 0) :
    count = count + 1
    if(i % 3 != 0 and i % 5 != 0):
      immigration = False;
      
if(immigration and count > 0):
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
N=int(input())
i = list(map(int, input().split()))
c=0

for k in range(0,N):
  if i[k]%2==0:
    if (i[k]%3!=0) or (i[k]%5!=0):
      c=c+1

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

Submission status: Wrong Answer

Solution code:
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:
            print(judge)
            break
print(judge)

Submission status: Wrong Answer

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



def check(i):
    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
            

                
B = True

for i in A :
    validation =  check(i)
    if validation == False:
        B = False
        break
        

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x=0
for i in A:
  if i%2==0:
    if not i%3==0 or i%5==0:
      print("DENIED")
      x=1
      break
    
  else:
   	continue
  break
if x ==0:
	print("APPROVED")

Submission status: Wrong Answer

Solution code:
N=int(input())#入力回数を決める

l=[]
num2=1
num3=1
l = list(map(int,input().rstrip().split()))
for i in range(N):
  
  if l[i] % 2 == 0:
    if l[i] % 3 == 0 or l[i] % 5 == 0:
      num2=0
    else:
      num3=0


  


        
if num2==0:
  if num3==0:
    print("DENIED")
  else:
    print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []
wk = 0

for i in range(n):
    if a[i]%2 == 0:
        b.append(a[i])

for j in range(len(b)):
    if b[j]%3 == 0 or b[j]%5 == 0:
        wk = 1
    else:
        wk = 0
        break
if wk == 0:
    print('DENIED')
else:
    print('APPROVED')

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
all_odd_flag = True


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

# すべて奇数の場合は拒否？
if all_odd_flag:
    print("DENIED")
    exit()

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

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 = []
for i in s:
    if i % 2 == 0:
        if i not in lis:
            print('DENIED')
print('APPROVED')

Submission status: Wrong Answer

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

x=len(B)
hantei=0
for i in range(x):
    if B[i]%3==0:
        hantei=hantei+1
    elif B[i]%5==0:
        hantei=hantei+1
    else:
        pass

if hantei>=2:
    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%2 == 0:
         if i%3 != 0:
            if i%5 != 0:
                print("DENIED")
                break
    c +=1
if c == a:
    print("APPROVE")

Submission status: Wrong Answer

Solution code:
number = int(input())
list_number = input().split()

ok = 0
for i in list_number:
    if int(i) % 2 == 0:
        if int(i) % 3 == 0 or int(i) % 5 == 0:
            pass
        else:
            ok = 1
            print("DENIED")

if ok == 0:
    print("APPROVED")

Submission status: Wrong Answer

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

evens = []
evens_count = 0
approved = "DENIED"
out_frag = 0

for i in range(n):
    if a[i] % 2 == 0:
        evens.append(a[i])
        evens_count += 1

if evens_count != 0:
    for j in range(evens_count):
        if not((evens[j] % 3 == 0) or (evens[j] % 5 == 0)):
            out_frag = 1
    if out_frag == 0:
        approved = "APPROVED"

print(approved)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
List=list(map(int,input().split()))
nList=[e for e in List if e % 2 == 0]
nnList=[f for f in nList if f % 3 == 0 or f % 5 == 0]
if not nnList:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
i=list(map(int,input().split()))
x=0

def c(x):
    if x==0:
        return "APPROVED"
    else:
        return "DENIED"

def d(x):
    if x%2==0:
        if x%3!=0:
            if x%5!=0:
                x+=1

for x in range(N):
    d(i[x])
c(x)

Submission status: Wrong Answer

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

x=len(B)
hantei=0
for i in range(x):
    if B[i]%3==0:
        hantei=hantei+1
    elif B[i]%5==0:
        hantei=hantei+1
    else:
        pass

if hantei>=2:
    print('APPROVED')
else:
    print('DENIED')

print(hantei)

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'
            break
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
arr = input().split() 
arr = [int(l) for l in arr]
even = [l for l in arr if l % 2 == 0]      
count = 0
for i in even: 
    if i % 3 == 0 or i % 5 == 0:
        count += 1
if count >= 1: 
    print("APPROVED")
else: 
    print("DENIED")

Submission status: Wrong Answer

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

count=0
for n in A:
    if (n % 2) == 0:
        if (n % 3) == 0 or (n % 5) == 0:
            count += 1
        else:
            print("DENIED")
            exit()

if count == 0:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

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



def check(i):
    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
            

                
B = []

for i in A :
    validation =  check(i)
    if validation == False:
        print("DENIED")
print("APPROVED")

Submission status: Wrong Answer

Solution code:
N=int(input())
a = list(map(int,input().split()))
c=0
i=0
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==0):
    print("APPROVED")
else:
    print("DENINED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
arr = input().split() 
arr = [int(l) for l in arr]
even = [l for l in arr if l % 2 == 0]      
count = 0
for i in even: 
    if i % 3 == 0 or i % 5 == 0:
        count += 1
if count == 1: 
    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 or i %5 ==0:

            print("APPROVED")

        else:
             print("DENIED")
        exit()
print("DENIED")

Submission status: Wrong Answer

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

flag = True
for i in l:
  if (i%3 != 0 and i%2 == 0) or (i%5 != 0 and i%2 == 0):
    flag = False
    break
    
if flag:
  print("APPROVED")
  
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
N=int(input())#入力回数を決める

l=[]
num2=1
num3=1
l = list(map(int,input().rstrip().split()))
for i in range(N):
  
  if l[i] % 2 == 0:
    if l[i] % 3 == 0 and l[i] % 5 == 0:
      num2=0
    else:
      num3=0


  


        
if num2==0:
  if num3==0:
    print("DENIED")
  else:
    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==0):
    print("APPROVED")
else:
    print("DENINED")

Submission status: Wrong Answer

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

count=0
for n in A:
    if (n % 2) == 0:
        count += 1
        if (n % 3) != 0 and (n % 5) != 0:
            print("DENIED")
            exit()

if count == 0:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
line1 = input('')
line2 = input('') 
result = True
cnt = int(line1)
list = line2.split(' ')
if len(list) != cnt:
  result = False
if result:
  for no_str in list:
    no = int(no_str)
    if no % 2 == 0:
      print(no)
      if no % 3 != 0 and no % 5 != 0:
        print(no)
        result = False

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