/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1969ms 3.125 MiB
#2 Accepted 2538ms 3.121 MiB
#3 Accepted 2263ms 3.121 MiB
#4 Accepted 2310ms 3.121 MiB
#5 Accepted 2520ms 3.117 MiB
#6 Accepted 2279ms 3.117 MiB
#7 Accepted 2127ms 3.125 MiB
#8 Accepted 2066ms 3.133 MiB
#9 Accepted 2064ms 3.117 MiB
#10 Accepted 2140ms 3.121 MiB
#11 Accepted 1946ms 3.137 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:01:03
Judged At
2024-11-11 03:36:27
Judged By
Score
100
Total Time
2538ms
Peak Memory
3.137 MiB