結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー vjudge1
提出日時 2025-02-05 01:12:02
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 542 bytes
コンパイル時間 1,074 ms
コンパイル使用メモリ 78,128 KB
実行使用メモリ 16,968 KB
最終ジャッジ日時 2025-02-05 01:12:51
合計ジャッジ時間 45,872 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 TLE * 1
other AC * 14 TLE * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long 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