/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Runtime Error Traceback (most recent call last): File "foo.py", line 13, in <module> NameError: name 'true' is not defined. Did you mean: 'True'? 18ms 3.066 MiB
#2 Accepted 18ms 3.094 MiB
#3 Runtime Error Traceback (most recent call last): File "foo.py", line 13, in <module> NameError: name 'true' is not defined. Did you mean: 'True'? 19ms 3.066 MiB
#4 Runtime Error Traceback (most recent call last): File "foo.py", line 13, in <module> NameError: name 'true' is not defined. Did you mean: 'True'? 19ms 2.984 MiB
#5 Accepted 18ms 3.0 MiB
#6 Runtime Error Traceback (most recent call last): File "foo.py", line 13, in <module> NameError: name 'true' is not defined. Did you mean: 'True'? 19ms 2.965 MiB
#7 Runtime Error Traceback (most recent call last): File "foo.py", line 13, in <module> NameError: name 'true' is not defined. Did you mean: 'True'? 19ms 3.117 MiB
#8 Runtime Error Traceback (most recent call last): File "foo.py", line 13, in <module> NameError: name 'true' is not defined. Did you mean: 'True'? 19ms 3.074 MiB
#9 Accepted 497ms 3.113 MiB
#10 Runtime Error Traceback (most recent call last): File "foo.py", line 13, in <module> NameError: name 'true' is not defined. Did you mean: 'True'? 19ms 3.066 MiB
#11 Runtime Error Traceback (most recent call last): File "foo.py", line 13, in <module> NameError: name 'true' is not defined. Did you mean: 'True'? 20ms 3.062 MiB

Code

cnt = 10000000000
ok = False
X,a,b,c,n=map(int,input().split())

x=n//a +1
y=n//b +1
z=n//c +1

for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            if(a*i+b*j+c*k+X == n):
                ok=true
                cnt=min(cnt,i+j+k)
if(ok):
    print("YES")
    print(cnt)
else:
    print("NO")

Information

Submit By
Type
Submission
Problem
P1028 Magical box and spell
Language
Python 3 (Python 3.12.3)
Submit At
2024-02-01 17:25:04
Judged At
2024-10-03 14:02:52
Judged By
Score
25
Total Time
497ms
Peak Memory
3.117 MiB