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:
        if a_list[i] % 3 == 0:
            a = 1
        elif a_list[i] % 5 == 0:
            a = 1
        else:
            c = 1
    

if c == 1:
    print("DENID")
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]%15!=0:
      ans="DENIED"
    
print(ans)

Submission status: Wrong Answer

Solution code:
a=input()
b=list(map(int,input().split()))
c=0
for k in b:
  if k%2==0:
    if k%3==0 or k%5==0:
      c+=1
    else:
      print('DENIED')
  else:
    c+=1
if c==int(a):
  print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = input()
list = input().split(" ")
for number in list:
  int_number = int(number)
  if (int_number % 2) == 0:
    if int_number %3 != 0:
      if int_number %5 != 0:
      	print("DENIED")
      	exit()
print("ACCEPTED")

Submission status: Wrong Answer

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

for target_list in a:
    c0 = target_list%2
    c1 = target_list%3
    c2 = target_list%5
    if c0 != 0:        
        if c1 != 0 or c2 != 0:
            print("DENIED")
    else:
        print("APPROVED")
        break

Submission status: Wrong Answer

Solution code:
N = int(input())
oddNum = set()

for x in list(map(int, input().split())):
    if (x % 2 == 0):
        oddNum.add(x)

if (len(oddNum) == 0):
    print("DENIED")

for o in oddNum:
    if ((o % 3 != 0) & (o % 5 != 0)):
        print("DENIED")
        exit()

print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

approved = True

for i in integers:
    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:
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) or (a_list[i] % 5 == 0):
            a = 1
        else:
            c = 1
    

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split(" ")]
check1 = 0
check2 = 0
for i in range(N):
    if A[i]%2==0:
        check1=1
        if A[i]%3!=0 and A[i]%5!=0:
            check2=1
            
if check1==1 and check2==0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
n =int(input())
A = [0 if int(x) % 2 == 1 or int(x) % 30 == 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())
li = list(map(int,input().split()))
flag = 0
for i in range(n):
    if((li[i] % 2 == 0) and (li[i] != 0)):
        if((li[i] % 3 == 0) or(li[i] % 5 == 0)):
            #print(li[i])
            flag=1
        else:
            #print(li[i])
            flag=0
            break


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

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = list(map(int, input().split(' ')))
flag = False

for i in range(N):
  if nums[i]%2 == 0 :
    
    if (nums[i]%3 != 0) | (nums[i]%5 != 0):
      flag = True
      print('DENIED')
      break
    else:
      continue
  else:
    continue
    
if flag == False:
  print('APPROVED')

Submission status: Wrong Answer

Solution code:
# import itertools
# import math


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    even = list(filter(lambda x: x % 2 == 0, A))

    for ee in even:
        if (ee % 3) != 0 and (ee % 5) != 0:
            print('DENYIED')
            return

    print('APPROVED')


resolve()

Submission status: Wrong Answer

Solution code:
num=int(input())
youso_list=input().split(' ')
boolean=True

for youso in youso_list:
    magic_num=0
    youso=int(youso)
    if youso%2!=0:
        continue
    
    if youso%3!=0:
        magic_num+=1
        
    if youso%5!=0:
        magic_num+=1
    
    if magic_num==2:
        boolean==False
        break

print(magic_num)
if boolean==False:
   print('APPROVED') 

elif boolean==True:
   print('DENIED')

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)

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

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

Submission status: Wrong Answer

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

ok = 0
ng = 0

for i in a:
    if (i % 2) == 0:
        if i % 3 == 0 or i % 5 == 0:
            ok += 1
        else:
            ng += 1

if ok >= 1 and ng == 0:
    ans = "APPROVED"
else:
    ans = "DENIED"

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

del a[n:]

new1 = [i for i in range(len(a)) if a[i] % 2 == 0]
new2 = [i for i in range(len(new1)) if (new1[i] != 0 and (new1[i] % 3 == 0 or new1[i] % 5 == 0))]

if len(new1) == len(new2):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
oddNum = set()

for x in list(map(int, input().split())):
    if (x % 2 == 0):
        oddNum.add(x)

if (len(oddNum) == 0):
    print("DENIED")

for o in range(len(oddNum)):
    if ((o % 3 != 0) | (o % 5 != 0)):
        print("DENIED")
        exit()

print("APPROVED")

Submission status: Wrong Answer

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

applist.append(N)
 
flag = 0
for i in applist:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      flag = 1
    else:
      flag = 0
      break

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

Submission status: Wrong Answer

Solution code:
num=int(input())
youso_list=input().split(' ')
boolean=True

for youso in youso_list:
    magic_num=0
    youso=int(youso)
    if youso%2!=0:
        continue
    
    if youso%3!=0:
        magic_num+=1
        
    if youso%5!=0:
        magic_num+=1
    
    if magic_num==2:
        boolean==False
        break

print(magic_num)
if boolean==False:
    print('DENIED')

elif boolean==True:
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
N=int(input())
data=list(map(int,input().split()))
ans="APPROVE"
for i in range(N):
    mo2=data[i]%2
    mo6=data[i]%6
    mo10=data[i]%10
    if mo2==0:
        if mo6==0 or mo10==0:
            ans="APPROVED"

        else:
            ans="DENIED"
            break
    else:
        continue
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
tuplea = tuple(map(int, input().split()))
ans = 0
for n in range(N):
    if tuplea[n]%2 == 1:
        pass
    else:
        if tuplea[n]%3 == 0 or tuplea[n]%5 == 0:
            pass
        else:
            print('DENIED')
            ans =1
if ans == 0:
    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]

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

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 = list(map(int, input().split()))
b = ""
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:
a = input()
num = [int(x) for x in input().split()]
print(num)
flag = True
for x in num:
  if x % 2 == 0:
    if x % 3 != 0 and x % 5 != 0:
      flag = False
if flag:
  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]

if len(aList) == 0:
    print("APPROVED")
    sys.exit(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())
a = list(map(int, input().split()))
judge = False

for i in range(n):
  if a[i]%2==0:
      if a[i]%3 == 0 or a[i]%5 == 0:
        judge = True
      else:
          break

print(['DENIED', 'APPROVED'][judge])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split(" ")]
check = 0
for i in range(N):
    if A[i]%2==0:
        if A[i]%3!=0 and A[i]%5!=0:
            check=1
            print("DENIED")
if check==0:
    print("APPROVED")

Submission status: Wrong Answer

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

A_i = [int(i) for i in A]

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

Submission status: Wrong Answer

Solution code:
n = input()
l = list(map(int, input().split()))
result = 'APPROVED'
for i in l:
  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())
X = [int(x) for x in input().split()]
print(X)
result = list(filter(lambda x: x % 2 == 0, X))
count = 0
for i in result:
    if i % 3 == 0 or i % 5 == 0:
        count += 1
print('APPROVED' if count == len(result) else 'DENIED')

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


# 入国条件処理
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:
a = input()
a = int(a)

line = [int(k) for k in input().split()]
b = 0
for k in range(len(line)):
  if line[k] % 2 == 0:
    if not line[k] % 5 == 0 and not line[k] % 3 == 0:
      print("DENIED")
      break
  elif k == a-1:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = input()
A = map(int, input().split())
even = [x for x in A if x%2 == 0]
count = []
for x in even:
    if x%3 == 0 or x%5 == 0:
        count.append(True)
if len(count) == len(even):
    print("Approved")
else:
    print("Denied")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


ans="DENIED"
for i in range(n):
  if a[i] % 2 == 0:
    if a[i] % 3 == 0 or a[i] % 5 == 0:
      ans = "APROVED"
      
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [int(s) for s in input().split(" ")]


def calculate(n,arr):

    for ar in arr:
        if ar % 2 == 0:
            s1 = ar % 3
            s2 = ar % 5
            if (s1 == 0) or (s2 == 0):
                print("APPROVED")
                return
            else:
                print("DENIED")
                return

    print("DENIED")

calculate(n,arr)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

del a[n:]

new1 = [i for i in range(len(a)) if a[i] % 2 == 0]
new2 = [i for i in range(len(new1)) if (new1[i] % 3 == 0 or new1[i] % 5 == 0)]

if len(new1) == len(new2):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())

s = list(map(int,input().split(" ")))
 
count = 0
for x in range(n):
  if s[x]%2 == 0 and (s[x]%5 != 0 or s[x]%3 != 0):
    count += 1
    
if count == 0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
L = list(map(int,input().split()))
L = [x for x in L if x%2 ==0]
if len(L) == 0:
    print("DENIED")
    exit()
for i in range(len(L)):
    if L[i]%3 == 0 or L[i]%5== 0:
        flag = True
    else:
        flag =False
        break
#print(L)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

check_list = []
for num in l:
    if num % 2 == 0:
        check_list.append(num)

n = len(check_list)
i = 0
while i < n:
    if (check_list[i] % 2 == 0) or (check_list[i] % 3 == 0):
        i += 1
    else: break
if i == n:
    print('APPROVED')
else: print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())

arr = [int(i) for i in input().split(maxsplit=(s - 1))]

a = []
n = -1

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


for i in a:
    n = 0
    if i % 3 != 0 and i % 5 != 0:
        n = 1
        print('DENIED')
        break

if n != 0:
    exit()

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

Submission status: Wrong Answer

Solution code:
N = input()
A = map(int, input().split())
even = []
count = 0
for x in A:
    if x % 2 == 0:
        even.append(x)
for x in even:
    if x%3 == 0 or x%5 == 0:
        count += 1
if count == len(even):
    print("Approved")
else:
    print("Denied")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

approved = True
no_gusu = True

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

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

Submission status: Wrong Answer

Solution code:
def main():
    _ = int(input())
    a = list(map(int, input().split()))
    flg = True
    for i in a:
        if i % 2 == 0:
            if i % 3 == 0 or i % 5 == 0:
                continue
            else:
                flg = False
                break

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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


ans="APROVED"
for i in range(n):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 and a[i] % 5 != 0:
      ans = "DENIED"
      
print(ans)

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 % 10  == 0 or num % 6 == 0:
        print('APPROVED')
        sys.exit(0)

print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split(" ")))
S = []
for a in A:
    if a % 2 == 0:
        S.append(a)
    else:
        pass
flag = True
for s in S:
    if s % 3==0 or s% 5==0:
        if s % 15 == 0:
            flag=False
        else:
            pass
    else:
        flag = False
if flag==True:
    print("APPROVED")
if flag == False:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
#coding:utf-8
n = int(input())
a = list(map(int, input().split()))
num = []

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

#print(num)

if len(num) == 0:
    print('DENIED')
    exit()
else:
    for j in range(0, len(num)):
        if num[j] % 3 != 0 and num[j] % 5 != 0:
            print('DENIED')
            exit()

print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
L = list(map(int,input().split()))
L = [x for x in L if x%2 ==0]
for i in range(len(L)):
    if L[i]%3 == 0 or L[i]%5== 0:
        flag = True
    else:
        flag =False
        break
#print(L)
if len(L) == 0:
    print("DENIED")
    exit()
if flag:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
a=int(input())
c=0
d=0
b=list(map(int,input().split()))
for i in range(a):
  if b[i]%2==0:
    
    if b[i]%3==0 or b[i]%5==0:
      pass
    else:
      print('DENINED')
      break
  else:
    pass
print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans = "APPROVED"
for i in range(len(A)):
    flag = 1
    if A[i]%2 == 0:
        if A[i]%3 != 0:
            flag = flag - 1
        if A[i]%5 != 0:
            flag = flag - 1  
        if flag < 0: 
            ans = "DENIED"
        print(flag)
print(ans)

Submission status: Wrong Answer

Solution code:
a = input()
num = [int(x) for x in input().split()]
flag = True
for x in num:
  if x % 2 == 0:
    if x % 3 != 0 and x % 5 != 0:
      flag = False
if flag:
  print('APPROVE')
else:
  print('DENIED')

Submission status: Wrong Answer

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

ans = 'APPRONED'
for i in range(0, n) :
  if a_list[i]%2 == 0 :
    if (a_list[i]%3)*(a_list[i]%5) != 0 :
      ans = 'DENIED'
      break
print(ans)

Submission status: Wrong Answer

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

result="APPROVED"
for i in range(N):
    if A[i]%2==0:
        guu.append(A[i])
for i in range(len(guu)):
    if (guu[i]%3!=0)and(A[i]%5!=0):
            result="DENIED"
            break

print(result)

Submission status: Wrong Answer

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

a_2 = [a for a in A_list if a%2==0]
flg = False
for a in a_2:
    if a % 3 ==0 or a % 5 ==0:
        flg = True
    else:
        print('DENIED')
        break
if flg == True:
    print('APPROVED')

Submission status: Wrong Answer

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

in_flag = True
for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            in_flag = True
        else:
            in_flag = False
    else:
        pass

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
cnt2,cnt35=0,0
for i in range(N):
    ai = A[i]
    if ai%2==0:
        cnt2+=1
        if (ai%3==0) or (ai%5==0):
            cnt35+=1

if cnt2==0 or cnt35==0:
    print('DENIED')
    exit()
else:
    if cnt2==cnt35:
        if cnt2==0:
            print('DENIED')
        else:
            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 or s % 5 == 0:
        m = 'APPROVED'
    else:
        m = 'DENIED'
        break
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout
def f(A):
	for i in A:
		if i%2==0:
			if i%3!=0 and i%5!=0:
				return 'DENIED'
	return 'APROVED'

def main():  	
	for x in stdin:

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
# N=5
# A=[6, 7, 9, 10, 31]
N=map(int,input())
A=list(map(int, input().split()))

A_even=[]
for i in A:
    if  (i%2)==0:
        A_even.append(i)
for i in A_even:
    if (i%3)==0 and (i%5)==0:
        print("DENIED")
        sys.exit()
print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
numbers = [int(x) for x in input().split()]
flag = 'APPROVED'
for number in numbers:
  if number%2==0 and (number % 3 == 0 or number % 5 == 0):
    continue
  else:
    flag = 'DENIED'
    break
print(flag)

Submission status: Wrong Answer

Solution code:
N = input()
A = map(int, input().split())
even = []
count = 0
for x in A:
    if x % 2 == 0:
        even.append(x)
for x in even:
    if x%3 == 0 or x%5 == 0:
        count += 1
    else:
        count -= 1
if count == len(even):
    print("Approved")
else:
    print("Denied")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
li = []
ans = "APPROVED"

for i in range(N):
  if A[i] % 2 == 0:
    li.append(A[i])

for i in li:
  if i % 5 == 0 or i % 3 == 0:
    ans = "APPROVED"
  else:
    ans = "DENIED"
    break

Submission status: Wrong Answer

Solution code:
a=int(input())
c=0
d=0
b=list(map(int,input().split()))
for i in range(a):
  if b[i]%2==0:
    
    if b[i]%3==0 or b[i]%5==0:
      pass
    else:
      print('DENINED')
  else:
    pass
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]

if len(aList) == 0:
    print("DENIED")
    sys.exit(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())
arr = [int(i) for i in input().split()]
flg = False
for d in arr :
  
  if d % 2 == 0 :
    
    if d % 3 == 0 :

      pass
    
    elif d % 5 ==0 : 
      pass
    
    else :

      print("DENIED")
      flg = True
      
if flg == False : 
  
  print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!python3.4.3

n = input()
a_list = list(map(int, input().split(' ')))
 
result = 'DENIED'
 
for a in a_list:
    if a%2 == 0 and (a%3 == 0 or a%5 == 0):
        result = 'APPROVED'
    elif a%2 == 0:
        result = 'DENIED'
        break
 
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
immi = list(map(int, input().split()))
flag = 0
for el in immi:
    if el // 2 == 0:
        if el // 3:
            if el // 5:
                flag = 1
                
if flag == 1:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
l = input().split()
l = l[1:]

flag = "APPROVED"
for n in l:
  if n % 2 == 0 and n%3 != 0 and n%5 != 0:
    flag = "DENIED"
    
print(flag)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = []
n = int(input())

for i in range(n):
  a.append(i)
e = 0
flag = True

for j in a:
  if j % 2 == 0:
    e += 1
    if j % 3 != 0 or j % 5 != 0:
      flag = False
      break
      

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

Submission status: Wrong Answer

Solution code:
N=int(input())
n=list(map(int, input().split()))
a=[i for i in n if i%2==0]
A=len(a)
b=[i for i in a if i%3!=0 and i%5!=0]
B=len(b)
print("Yes" if B==0 else "No")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = []
C = []
for i in range(N):
  if A[i]%2 == 0:
    B.append(A[i])
if len(B) == 0:
  print('APPROVED')
for j in range(len(B)):
  if B[j]%3 == 0 or B[j]%5 == 0:
    C.append(B[j])
if len(B) == len(C):
  print('APPROVED')
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

    box = []
    for i in range(n):
        if syorui[i]%2 == 0:
            if syorui[i]%3 == 0 or syorui[i]%5 == 0:
                flg = True
            else:
                break
    if flg == True:
        print("APPROVED")
    else:
        print("DENIED")
main()

Submission status: Wrong Answer

Solution code:
a=input()
b=list(map(int,input().split()))
c=0
for k in b:
  if k%2==0:
    if k%3==0 or k%5==0:
      c+=1
      continue
    else:
      print('DENIED')
  else:
    c+=1
if c==int(a):
  print('APPROVED')

Submission status: Wrong Answer

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

ans = "DENIED"
andflg = 1

for i in range(N):
    if A[i] % 2 == 0 and andflg == 1:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            ans = "APPROVED"
        else:
            ans = "DENIED"
            andflg = 0

print(ans)