結果

問題 No.8022 縛りFizzBuzz (Easy)
コンテスト
ユーザー 1119_2916
提出日時 2017-03-31 22:34:55
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 847 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 953 ms
コンパイル使用メモリ 174,500 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-28 19:34:17
合計ジャッジ時間 1,362 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
 
using namespace std;
 
#define int long long
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);
 
// assign
 
signed main()
{
    Int(n);
    for (int i = 'b' - 'a'; i <= n; i++) {
        if ( (!(i % ('d' - 'a'))) && (!(i % ('f' - 'a'))) ) {
            cout << "FizzBuzz" << endl;
        } else if (!(i % ('d' - 'a'))) {
            cout << "Fizz" << endl;
        } else if (!(i % ('f' - 'a'))) {
            cout << "Buzz" << endl;
        } else {
            cout << i << endl;
        }
    }
    return ('a' - 'a');
}
0