結果

問題 No.3022 縛りFizzBuzz (Easy)
ユーザー KKT89KKT89
提出日時 2020-07-13 15:48:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 873 bytes
コンパイル時間 932 ms
コンパイル使用メモリ 111,272 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-07 14:36:27
合計ジャッジ時間 1,756 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
using namespace std;
typedef long long int ll;
using ull = unsigned long long;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> v((n+n+n)*(n+n+n));
    v[n+n]++;
    v[n+n]++;
    v[n+n]++;
    v[n+n+n]++;
    v[n+n+n]++;
    v[n+n+n]++;
    v[n+n+n]++;
    v[n+n+n]++;
    v[n]++;
    for(int i=v[n];i<=n;i++){
        if(!(i%v[n+n])&&!(i%v[n+n+n])){
            printf("Fizzbuzz\n");
        }
        else if(!(i%v[n+n])){
            printf("Fizz\n");
        }
        else if(!(i%v[n+n+n])){
            printf("Buzz\n");
        }
        else{
            printf("%d\n",i );
        }
    }
}
0