提出 #5352123


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

int main(void) {
  int R, G, B, N; cin >> R >> G >> B >> N;
  int a = 0;
  for (int i = 0; i <= N/R; i++) {
    for (int j = 0; j <= (N-i*R)/G; j++) {
      if ((N-(i*R+j*G))%B == 0) a++;
    }
  }
  cout << a << endl;

  return 0;
}

提出情報

提出日時
問題 B - RGB Boxes
ユーザ kahuu
言語 C++14 (GCC 5.4.1)
得点 200
コード長 296 Byte
結果 AC
実行時間 14 ms
メモリ 256 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 11
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
rand_01.txt AC 1 ms 256 KiB
rand_02.txt AC 1 ms 256 KiB
rand_03.txt AC 1 ms 256 KiB
rand_04.txt AC 1 ms 256 KiB
rand_05.txt AC 1 ms 256 KiB
rand_06.txt AC 11 ms 256 KiB
rand_07.txt AC 1 ms 256 KiB
rand_08.txt AC 14 ms 256 KiB
rand_09.txt AC 1 ms 256 KiB
sample_01.txt AC 1 ms 256 KiB
sample_02.txt AC 2 ms 256 KiB