結果

問題 No.593 4進FizzBuzz
コンテスト
ユーザー kosakkun
提出日時 2017-11-10 22:28:27
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,014 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,058 ms
コンパイル使用メモリ 133,100 KB
実行使用メモリ 7,460 KB
最終ジャッジ日時 2026-05-18 12:38:00
合計ジャッジ時間 3,427 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;

int main() {

    string S; cin >> S;

    long long N = 0;
    REP(i,S.size()) {
        N *= 4;
        N += (S[i] - '0');
    }

    if (N % 3 == 0 && N % 5 == 0) {
        cout << "FizzBuzz" << endl;
    } else if (N % 3 == 0) {
        cout << "Fizz" << endl;
    } else if (N % 5 == 0) {
        cout << "Buzz" << endl;
    } else {
        cout << S << endl;
    }

    return 0;
}
0