結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー vjudge1
提出日時 2025-02-05 01:10:20
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 479 bytes
コンパイル時間 1,317 ms
コンパイル使用メモリ 66,880 KB
実行使用メモリ 16,848 KB
最終ジャッジ日時 2025-02-05 01:11:10
合計ジャッジ時間 47,184 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 TLE * 1
other AC * 13 TLE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

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

    long long a, b, c;
    cin >> a >> b >> c;

    int mulA = 0;
    int mulB = 0;
    int mulc = 0;

    for (long long i = 1; i <= n; i++)
    {
        if (i % a == 0)
        {
            mulA++;
        }
        else if (i % b == 0)
        {
            mulB++;
        }
        else if (i % c == 0)
        {
            mulc++;
        }
    }

    cout << mulA + mulB + mulc << endl;
}
0