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

for i in a:                     # range(n)ではダメ
    if i % 2 == 0:
        if i % 3 and i % 5:
            print('DENIED')
            exit(0)
else:
    print('APPROVE')

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 and i % 5:
            print('DENIED')
            exit()
else:
    print('APPROVE')

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 and i % 5:
            print('DENIED')
            break
else:
    print('APPROVE')

Submission status: Wrong Answer

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

for i in a:
    if not i%2 and i%3 and i%5:
        print("DENIED")
        break
    else:
        print("APPROVED")

Submission status: Wrong Answer

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

for anum in anums:
    if (anum % 2 == 0) and ((anum % 3 == 0) or (anum % 5 == 0)):
        result = 'APPROVED'
    else:
        result = 'DENIED'
        break

print(result)

Submission status: Wrong Answer

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

for anum in anums:
    if (anum % 2 == 0) and ((anum % 3 == 0) or (anum % 5 == 0)):
        result = 'APPROVED'
        break
    else:
        result = 'DENIED'

print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

result = "APPRPVED"
for num in nums:
    if(num % 2 == 0):
        if((num % 3 != 0) or (num % 5 != 0)):
            result = "DENIED"
            break

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

result = 'APPROVED'
for i in A:

    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            result = 'APPROVED'
        else:
            result = 'DENIED'
        break

print(result)

Submission status: Wrong Answer

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

ans = any((i % 3) * (i % 5) for i in a if i % 2 == 0)
print('DENIED' if ans else 'APPROVED')

if n==3:
  print(n)

Submission status: Wrong Answer

Solution code:
S_list = [input() for i in range(2)]
S_list_1 = S_list[1].split()

even_list = []
for i in S_list_1:   
    if int(i) % 2 == 0 :
        even_list.append(int(i))

if (bool(even_list)) == False:
    even_list =[1]
    
for i in even_list:
    if i % 3 !=0 and i % 5 !=0 :
        result="DENIED"
        break
    else:
        result="APPROVED"        
print(result)

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc155/tasks/abc155_b
S_list = [input() for i in range(2)]
S_list_1 = S_list[1].split()

even_list = []
for i in S_list_1:   
    if int(i) % 2 == 0 and int(i) != 0:
        even_list.append(int(i))

if (bool(even_list)) == False:
    even_list =[1]
    
for i in even_list:
    if i % 3 ==0 or i % 5 ==0 :
        result="APPROVED"
    else:
        result="DENIED"
        break
print(result)

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc155/tasks/abc155_b
S_list = [input() for i in range(2)]
S_list_1 = S_list[1].split()

even_list = []
for i in S_list_1:   
    if int(i) % 2 == 0:
        even_list.append(int(i))

if (bool(even_list)) == False:
    even_list =[1]
    
for i in even_list:
    if i % 3 ==0 or i % 5 ==0 :
        result="APPROVED"
    else:
        result="DENIED"
        break
print(result)

Submission status: Wrong Answer

Solution code:
S_list = [input() for i in range(2)]
S_list_1 = S_list[1].split()

even_list = []
for i in S_list_1:   
    if int(i) % 2 == 0:
        even_list.append(int(i))

if (even_list is None) == False:
    even_list =[1]
    
for i in even_list:
    if i % 3 ==0 or i % 5 ==0 :
        result="APPROVED"
    else:
        result="DENIED"
        break
print(result)

Submission status: Wrong Answer

Solution code:
S_list = [input() for i in range(2)]
S_list_1 = S_list[1].split()
   
for i in S_list_1:
    if int(i) % 6 ==0 or int(i) % 10 ==0 :
        result="APPROVED"
    else:
        result="DENIED"
        break
print(result)

Submission status: Wrong Answer

Solution code:
S_list = [input() for i in range(2)]
S_list_1 = S_list[1].split()
even_list = []
for i in S_list_1:   
    if int(i) % 2 == 0:
        even_list.append(int(i))

if (even_list is None) == False:
    result = "DENIED"

for i in even_list:
    if i % 3 ==0 or i % 5 ==0 :
        result="APPROVED"
    else:
        result="DENIED"
        break
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

even = []
approved = []
denied = []

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

for i in even:
    if i % 3 == 0 or i % 5 == 0:
        approved.append(i)
    else:
        denied.append(i)

if not denied:          # リスト内が空かどうか
    print("APPROVED")
else:
    print("DENTED")

Submission status: Wrong Answer

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

t = 0
for i in range(N):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            t += 1
        break

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

Submission status: Wrong Answer

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

t = 0
for i in range(N):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            t += 1
    break
print('APPROVED' if t == 0 else 'DENIED')

Submission status: Wrong Answer

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

t = 0
for i in range(N):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            t += 1
    break
print('APPROPVED' if t == 0 else 'DENIED')

Submission status: Wrong Answer

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

t = 0
for i in range(N):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            t += 1
    break
print('APPRPVED' if t == 0 else 'DENIED')

Submission status: Wrong Answer

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

answer = 'DENIED'
for i in range(0, N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            answer = 'APPROVED'
        else:
            answer = 'DENIED'
            break

print(answer)

Submission status: Wrong Answer

Solution code:
x = int(input())

if x % 3 == 0:
    print('APPROVED')
elif x % 5 == 0:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
data = list(map(int,input().split()))
sw1 = 0
sw2 = 0
for i in range(0,len(data)):
    if data[i] % 2 == 0:
        sw1 += 1
        if data[i] % 3 == 0 or data[i] % 5 == 0:
            sw2 += 1

print(sw1,sw2)
if sw1 >= 0 and sw1 == sw2:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
data = list(map(int,input().split()))
sw1 = 0
sw2 = 0
for i in range(0,len(data)):
    if data[i] % 2 == 0:
        sw1 += 1
        if data[i] % 3 == 0 or data[i] % 5 == 0:
            sw2 += 1

print(sw1,sw2)
if sw1 > 0 and sw1 == sw2:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
data = list(input().split())
sw1 = 0
sw2 = 0
for i in range(0,len(data)):
    if int(data[i]) % 2 == 0:
        sw1 += 1
        if int(data[i]) % 3 == 0 or int(data[i]) % 5 == 0:
            sw2 += 1

print(sw1,sw2)
if sw1 > 0 and sw1 == sw2:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
data = list(input().split())
sw1 = 0
sw2 = 0
for i in range(0,len(data)):
    if int(data[i]) % 2 == 0:
        sw1 += 1
        if int(data[i]) % 3 == 0 or int(data[i]) % 5 == 0:
            sw2 += 1

if sw1 > 0 and sw1 == sw2:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
data = list(input().split())
sw = 0
for i in range(0,len(data)):
    if int(data[i]) % 2 == 0:
        if int(data[i]) % 3 == 0 or int(data[i]) % 5 == 0:
            sw = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(len(a)):
    if a[i]%2!=0:
        b.remove(a[i])

for i in b:
    if i%3!=0:
        if i%5!=0:
            print(i)
            print('DENIED')
            sys.exit()
            
print('APPROVED')

Submission status: Wrong Answer

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

for i in a:
    if i%2!=0:
        a.remove(i)

for i in a:
    if i%3!=0:
        if i%5!=0:
            print('DENIED')
            sys.exit()
            
print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0:
            ch3 = 1
        if a[i] % 5 == 0:
            ch5 = 1

if ch3*ch5==1:
    ans='APPROVED'
else:
    ans = 'DENIED'
    
print(ans)

Submission status: Wrong Answer

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

for i in x :
    if i % 2 == 0 :
      if  i % 3!=0 or i % 5 !=0:
        print('DENIED')
        exit()

print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())

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

boolian = False

for i in range(N):
    if an[i] % 2 == 0:
        if an[i] % 3 ==0 or an[i] % 5 ==0:
            boolian = True
        else:
            boolian = False
            break
if boolian == False:
    print('DENIED')
    
if boolian == True:
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())

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

boolian = False

for i in range(N):
    if an[i] % 2 == 0:
        if an[i] % 3 ==0 or an[i] % 5 ==0:
            boolian = True
        else:
            boolian = False
            break
if boolian == False:
    print('DNIED')
    
if boolian == True:
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())
S = list(map(int,input().split()))
B= list()
X = list()
for i in S:
    if i % 2== 0:
        B.append(i)
for n in B:
    if n % 3 == 0 or n % 5 == 0:
        X.append(n)
if len(B) == len(X):
    print('APPROVE')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
print("APPROVED" if all(i % 6 == 0 or i % 10 == 0 for i in a) else "DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()

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

Submission status: Wrong Answer

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    A = list(map(int, readline().split()))

    def judge():
        for x in A:
            if x % 2 == 0:
                if x % 3 != 0 or x % 5 != 0:
                    return False
        return True

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

Submission status: Wrong Answer

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

bad = 0
for i in range(n):
    if(A[i] % 2):
        if(A[i] % 3 != 0 or A[i] % 5 != 0):
            bad += 1

if(bad >= 1):
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

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

bad = 0
for i in range(n):
    if(A[i] % 2):
        if(A[i] % 3 != 0 or A[i] % 5 != 0):
            bad += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
S=[int(s) for s in input().split()]
for i in range(N):
    if S[i]%2==0 and S[i]%15!=0:
        print("DENIED")
    elif i==N-1:
        print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(n):
    if A[i]%6==0 or A[i]%10==0:
        print("APPROVED")
    else:
        print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
li=list(map(int,input().split()))
li2=[]
x=0

for n in range(N):
  if li[n]%2 == 0:
    if ((li[n]%3 == 0) or (li[n]%5== 0)):
      li[n]="ok"
    li2.append(li[n])
  else:
    pass
  x=x+1
   
if li2.count("ok")==x:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
N=int(input())
li=list(map(int,input().split()))
li2=[]
x=0

for n in range(N):
  if li[n]%2 == 0:
    if ((li[n]%3 == 0) or (li[n]%5== 0)):
      li[n]="ok"
    else:
      li[n]=1
    li2.append(li[n])
  else:
    pass
  x=x+1
   
if li2.count("ok")==x:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
  if i % 3 != 0 and i % 5 != 0:
    flag = "DENIED"
    
print(flag)

Submission status: Wrong Answer

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

gu = []
ans = []

for i in range(N-1):
    if A[i] % 2 == 0:
        gu.append(A[i])
    else:
        pass

for j in range(len(gu)):
    if gu[j] % 3 == 0 or gu[j] % 5 == 0:
        ans.append(gu[j])
    else:
        pass

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

Submission status: Wrong Answer

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

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

print('APPROVED')

Submission status: Wrong Answer

Solution code:
# B Papers,Please
n = int(input())
a = list(map(int, input().split()))
ans = 0
ant = 0
for i in range(n):
    if a[i] % 2 == 0:
        ant += 1
        if a[i] % 3 == 0:
            ans += 1
        elif a[i] % 5 == 0:
            ans += 1

if ant == ans:
    if ant > 0:
        print("APPROVED")
    else:
        print("DENIED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N=int(input())
list1=[]
list2=[]
for i in map(int,input().split()):
    if i % 2 == 0:
        list1.append(i)
    if i % 2 == 0 and i % 3 == 0:
        list2.append(i)
    if i % 2 == 0 and i % 5 ==0:
        list2.append(i)
if list1 == list2:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin 

def main():
    n = int(input())
    a = list(map(int, input().split()))
    flag = False

    for i in range(n):
        if (a[i] % 2 == 0):
            if  a[i] % 3 == 0 or a[i] % 5 == 0:
                flag = True
            else:
                flag = False
                break
    if flag:
        print('APPROVED')
    else:
        print('DENIED')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(int(x) for x in input().split() if int(x)%2==0)
ok = True
for i in a:
  if i%3==0 or i%5==0:
    print('DENIED')
    ok = False
    break
if ok:
  print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(int(x) for x in input().split() if int(x)%2==0)
ok = True
for i in a:
  if i%3!=0 and i%5!=0:
    print('DENIED')
    ok = False
if ok:
  print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
a = True
for x in A:
	if x % 2 == 0:
		if not(x % 3 == 0 or x % 5 == 0):
			print(x)
			a = False
			break
if a:
	print('APPROVED')
else:
	print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in ai:
    if i%2 == 0 and i%3 == 0 or i%5 == 0:
        print('APPROVED')
        break
else:
    print('DENIED')

Submission status: Wrong Answer

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

for i in ai:
    if i%2 == 0 and i%3 == 0 or i%5 == 0:
        print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N = I()

A = LI()

ans = False
for a in A:
    if a % 2 != 0:
        continue

    if a % 3 == 0 or a % 5 == 0:
        ans = True

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

Submission status: Wrong Answer

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

    for a in A:
        if a % 2 == 0:
            if not a % 3 == 0 or a % 5 == 0:
                print('DENIED')
                return
    print('APPROVED')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())

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

t=1

for i in range(n):
    if a[i]%2==0 and a[i]%3==0 and a[i]%5==0:
        t=1
    elif a[i]%2==1:
        t=1
    else:
        t=0
        break 

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

Submission status: Wrong Answer

Solution code:
# Papers, Please

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

for Ai in A:
  if Ai % 2 == 1:
    continue
  else:
    if Ai % 3 != 0 and Ai % 5 != 0:
      print("DENIED")
      exit()

print("AOOROVED")

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
a=[]
b=[]
for i in A:
    if i%2==0:
        a.append(i)
for n in a:
    if n%3==0 or n%5==0:
        b.append(n)
if len(a)==len(b):
    print('APPROAD')
else:
    print('DENIED')

Submission status: Wrong Answer

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

ans = 'APPROVED'

for i in range(N):
  if A[i] % 2 == 0 and A[i] % 6 != 0 and A[i] % 10 != 0:
    print(A[i])
    ans = 'DENIED'
    break

print(ans)

Submission status: Wrong Answer

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

ans = 'APPROVED'

for i in range(N):
  if A[i] % 2 == 0 or A[i] % 6 == 0 or A[i] % 10:
    continue
  else:
    ans = 'DENIED'
    break

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = True
for i in a:
  if i % 2 == 0:
    if not i % 3 == 0 or i % 5 == 0:
      ans = False
      break
if ans:
  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]%3!=0 or A[i]%5!=0:
      ans = "DENIED"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':

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

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

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 == 0 or A[i]%5 == 0:
      print('APPROVED')
      sys.exit()
print('DENIED')

Submission status: Wrong Answer

Solution code:
n, s, f = int(input()), list(map(int, input().split())), True
for e in s:
  if not e & 1:
    if e % 3 != 0 or e % 5 != 0: f = False; break
print('APPROVED' if f else 'DENIED')

Submission status: Wrong Answer

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

for i in range(n):
    if a[i]%5!=0 and a[i]%3!=0:
        print('DENIED')
        break
else:
    print('APPROVED')

Submission status: Wrong Answer

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