Submission #19407966


Source Code Expand

Copy
r, g, b, n =map(int,input().split())

[r, g, b] = sorted([r,g,b])
ans =0
p =n//b
for i in range(p+1):
  res =n-b*i
  q =res//g
  for j in range(q+1):
    if (n-i*b-j*g)%r==0:
      ans +=1
print(ans)

Submission Info

Submission Time
Task B - RGB Boxes
User yasutakah
Language Python (3.8.2)
Score 200
Code Size 210 Byte
Status AC
Exec Time 1088 ms
Memory 9088 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 8848 KB
rand_02.txt AC 20 ms 9040 KB
rand_03.txt AC 17 ms 8844 KB
rand_04.txt AC 21 ms 8812 KB
rand_05.txt AC 19 ms 9008 KB
rand_06.txt AC 765 ms 8940 KB
rand_07.txt AC 19 ms 8836 KB
rand_08.txt AC 1088 ms 8988 KB
rand_09.txt AC 21 ms 9064 KB
sample_01.txt AC 18 ms 9088 KB
sample_02.txt AC 51 ms 9004 KB