/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1978ms 3.125 MiB
#2 Accepted 2357ms 3.117 MiB
#3 Accepted 2348ms 3.125 MiB
#4 Accepted 2452ms 3.129 MiB
#5 Accepted 2251ms 3.121 MiB
#6 Accepted 2330ms 3.129 MiB
#7 Accepted 2071ms 3.121 MiB
#8 Accepted 2148ms 3.121 MiB
#9 Accepted 2062ms 3.121 MiB
#10 Accepted 2075ms 3.121 MiB
#11 Accepted 1904ms 3.133 MiB

Code

x,a,b,c,n=map(int,input().split())
p=[]
for i in range(201):
    for j in range(201):
        for k in range(201):
            if x+(i*a)+(j*b)+(c*k)==n:
                p.append((i+j+k))
if(len(p)>0):
    print("YES")
    print(min(p))
else:
    print("NO")

Information

Submit By
Type
Submission
Problem
P1028 Magical box and spell
Language
Python 3 (Python 3.12.3)
Submit At
2024-04-02 08:09:30
Judged At
2024-11-11 03:36:26
Judged By
Score
100
Total Time
2452ms
Peak Memory
3.133 MiB