Submission #5372025
Source Code Expand
Copy
import mathr,g,b,n = map(int, input().split())count = 0r,g,b = sorted((r,g,b), reverse=True)for x in range( math.ceil((n / r)) + 1):for y in range( math.ceil( (n - (r*x) ) / g) + 1):if (n - (r*x) - (y*g)) < 0:breakif ((n - (r*x) - (g * y)) % b) == 0:count = count + 1print(count)
import math r,g,b,n = map(int, input().split()) count = 0 r,g,b = sorted((r,g,b), reverse=True) for x in range( math.ceil((n / r)) + 1): for y in range( math.ceil( (n - (r*x) ) / g) + 1): if (n - (r*x) - (y*g)) < 0: break if ((n - (r*x) - (g * y)) % b) == 0: count = count + 1 print(count)
Submission Info
Submission Time | |
---|---|
Task | B - RGB Boxes |
User | recuraki |
Language | PyPy3 (2.4.0) |
Score | 200 |
Code Size | 343 Byte |
Status | AC |
Exec Time | 209 ms |
Memory | 40556 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
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 | 160 ms | 38384 KB |
rand_02.txt | AC | 162 ms | 38256 KB |
rand_03.txt | AC | 160 ms | 38256 KB |
rand_04.txt | AC | 161 ms | 38256 KB |
rand_05.txt | AC | 160 ms | 38256 KB |
rand_06.txt | AC | 198 ms | 40556 KB |
rand_07.txt | AC | 161 ms | 38256 KB |
rand_08.txt | AC | 209 ms | 40556 KB |
rand_09.txt | AC | 161 ms | 38256 KB |
sample_01.txt | AC | 162 ms | 38256 KB |
sample_02.txt | AC | 170 ms | 38640 KB |