-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2629.py
More file actions
29 lines (21 loc) · 666 Bytes
/
2629.py
File metadata and controls
29 lines (21 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#보류
coocnt = int(input())
coolist = list(map(int,input().split()))
goocnt = int(input())
goolist = list(map(int,input().split()))
from itertools import cominations
cnt = ['N' for _ in range(40001)]
for i in range(coocnt):
cnt[coolist[i]] = 'Y'
for i in range(1,coocnt + 1):
combi = list(combinations(coolist,i))
for tu in combi:
for weight in tu:
for weight1 in weight:
if len(weight) == 1:
cnt[weight1] = 'Y'
for j in range(i+1,coocnt):
cnt[coolist[j] + coolist[i]] = 'Y'
cnt[coolist[j] - coolist[i]] = 'Y'
for i in range(goocnt):
print(cnt[goolist[i]],end=' ')