Submission #19703123


Source Code Expand

Copy
#include <iostream>
#include <vector>

int main() {
  int r, g, b, n;
  std::cin >> r >> g >> b >> n;

  int cnt = 0;
  for (int i = 0; i <= n / r; ++i) {
    for (int j = 0; j <= (n - r * i) / g; ++j) {
      int k = (n - r * i - g * j) / b;
      if (r * i + g * j + b * k == n) ++cnt;
    }
  }

  std::cout << cnt << std::endl;
  return 0;
}

Submission Info

Submission Time
Task B - RGB Boxes
User hotaosa
Language C++ (GCC 9.2.1)
Score 200
Code Size 364 Byte
Status AC
Exec Time 30 ms
Memory 3620 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 9 ms 3600 KB
rand_02.txt AC 2 ms 3560 KB
rand_03.txt AC 2 ms 3532 KB
rand_04.txt AC 2 ms 3620 KB
rand_05.txt AC 2 ms 3448 KB
rand_06.txt AC 16 ms 3596 KB
rand_07.txt AC 3 ms 3420 KB
rand_08.txt AC 30 ms 3444 KB
rand_09.txt AC 2 ms 3572 KB
sample_01.txt AC 3 ms 3460 KB
sample_02.txt AC 5 ms 3460 KB