Submission #19726216


Source Code Expand

Copy
R,G,B,N = map(int,input().split())
ans = 0
for r in range(N//R+1):
    for g in range((N-R*r)//G+1):
        res = N-R*r-G*g
        if res >= 0 and res%B == 0:
            ans += 1
print(ans)

Submission Info

Submission Time
Task B - RGB Boxes
User ryuji1011
Language Python (3.8.2)
Score 200
Code Size 199 Byte
Status AC
Exec Time 1396 ms
Memory 9000 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 11
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All rand_01.txt, rand_02.txt, rand_03.txt, rand_04.txt, rand_05.txt, rand_06.txt, rand_07.txt, rand_08.txt, rand_09.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
rand_01.txt AC 18 ms 8948 KB
rand_02.txt AC 20 ms 8864 KB
rand_03.txt AC 18 ms 8860 KB
rand_04.txt AC 20 ms 8868 KB
rand_05.txt AC 17 ms 8864 KB
rand_06.txt AC 920 ms 9000 KB
rand_07.txt AC 25 ms 8944 KB
rand_08.txt AC 1396 ms 8948 KB
rand_09.txt AC 24 ms 8968 KB
sample_01.txt AC 17 ms 8876 KB
sample_02.txt AC 115 ms 8960 KB