結果

問題 No.593 4進FizzBuzz
ユーザー kosakkunkosakkun
提出日時 2017-11-10 22:44:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,209 bytes
コンパイル時間 916 ms
コンパイル使用メモリ 112,336 KB
実行使用メモリ 8,996 KB
最終ジャッジ日時 2024-05-03 12:57:16
合計ジャッジ時間 3,347 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 1 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 50 ms
7,184 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 51 ms
7,312 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 52 ms
7,188 KB
testcase_29 WA -
testcase_30 AC 51 ms
7,184 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 N1 = 0, N2 = 0;
    bool flag1 = false;
    bool flag2 = false;
    REP(i,S.size()) {
        N1 *= 4;
        N1 += (S[i] - '0');
        if (N1 % 3 == 0) flag1 = true;
        N1 %= 3;
        N2 *= 4;
        N2 += (S[i] - '0');
        if (N2 % 5 == 0) flag2 = true;
        N2 %= 5;
    }

    if (flag1 & flag2) {
        cout << "FizzBuzz" << endl;
    } else if (flag1) {
        cout << "Fizz" << endl;
    } else if (flag2) {
        cout << "Buzz" << endl;
    } else {
        cout << S << endl;
    }

    return 0;
}
0