結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー vjudge1
提出日時 2025-02-05 03:41:40
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 621 bytes
コンパイル時間 1,309 ms
コンパイル使用メモリ 77,904 KB
実行使用メモリ 13,568 KB
最終ジャッジ日時 2025-02-05 03:42:07
合計ジャッジ時間 23,080 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 26 TLE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int calProd(int a, int b, int c, int N)
{
    int count = 0;
    int product = 1;
    while (count < N)
    {
        if (count % 3 == 0)
        {
            product *= a;
        }
        else if (count % 3 == 1)
        {
            product *= b;
        }
        else
        {
            product *= c;
        }
        count++;
    }
    return product;
}

int main()
{
    int N;
    cin >> N;

    int num1, num2, num3;
    cin >> num1;
    cin >> num2;
    cin >> num3;

    int product = calProd(num1, num2, num3, N);

    cout << product << endl;

    return 0;
}
0