結果

問題 No.593 4進FizzBuzz
ユーザー fushime2fushime2
提出日時 2017-11-21 19:41:18
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 829 bytes
コンパイル時間 1,225 ms
コンパイル使用メモリ 159,152 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-26 08:21:21
合計ジャッジ時間 3,851 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> mat;
#define FOR(i,a,b) for(int (i)=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define mset(a,x) memset(a,x,sizeof(a))
#define FASTIO cin.tie(0),ios::sync_with_stdio(0)

#define int long long

int conv(int n) {
    int p = 0;
    int i = 0;
    while (n) {
        p += (n % 10) * pow(4, i++);
        n /= 10;
    }
    return p;
}

signed main() {
    int n;
    cin >> n;

    int t = conv(n);
    if (t % 3 == 0 && t % 5 == 0) {
        puts("FizzBuzz");
    }
    else if (t % 3 == 0) {
        puts("Fizz");
    }
    else if (t % 5 == 0) {
        puts("Buzz");
    }
    else {
        cout << n << endl;
    }

    return 0;
}
0