| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1089463 | vjudge1 | 은행 (IZhO14_bank) | Pypy 2 | 23 ms | 19396 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
n, m = map(int, input().split())
valores = map(int, input().split())
notas = map(int, input().split())
residual = [-1] * (1 << m)
cobertos = [-1] * (1 << m)
residual[0] = 0
cobertos[0] = 0
possivel = 1
for s in range(1 << m):
for p in range(m):
if (s & (1 << p)) == 0:
continue
ant = s & ~(1 << p)
if cobertos[ant] == -1:
continue
novo = residual[ant] + notas[p]
if cobertos[ant] < n:
alvo = valores[cobertos[ant]]
else:
continue
if novo < alvo:
cobertos[s] = cobertos[ant]
residual[s] = novo
elif novo == alvo:
cobertos[s] = cobertos[ant] + 1
residual[s] = 0
if cobertos[s] == n:
possivel = 0
if possivel == 0:
print "YES"
else:
print "NO"| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
