Submission #19730488


Source Code Expand

Copy
R, G, B, N = map(int, input().split())
num = 0
a = [R, G, B]
a = sorted(a, reverse=True)
for i in range(N // a[0], -1, -1):
    for j in range((N - i * a[0]) // a[1], -1, -1):
        if (N - i * a[0] - j * a[1]) % a[2] == 0:
            num += 1

print(num)

Submission Info

Submission Time
Task B - RGB Boxes
User happa_D
Language Python (3.8.2)
Score 200
Code Size 267 Byte
Status AC
Exec Time 1233 ms
Memory 9140 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 20 ms 8876 KB
rand_02.txt AC 20 ms 9032 KB
rand_03.txt AC 26 ms 8876 KB
rand_04.txt AC 18 ms 8884 KB
rand_05.txt AC 19 ms 9140 KB
rand_06.txt AC 808 ms 9036 KB
rand_07.txt AC 16 ms 8876 KB
rand_08.txt AC 1233 ms 9040 KB
rand_09.txt AC 19 ms 8984 KB
sample_01.txt AC 18 ms 8876 KB
sample_02.txt AC 50 ms 9140 KB