結果

問題 No.593 4進FizzBuzz
ユーザー kichirb3
提出日時 2018-03-17 15:25:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 585 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 64,512 KB
実行使用メモリ 7,784 KB
最終ジャッジ日時 2024-12-24 00:26:25
合計ジャッジ時間 4,228 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 RE * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.593 4進FizzBuzz
// https://yukicoder.me/problems/no/593
//
#include <iostream>
#include <string>
using namespace std;

string solve(string &&s);


int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    string s;
    cin >> s;
    string ans = solve(move(s));
    cout << ans << endl;
}

string solve(string &&s) {
    string ans = s;
    int n = stoi(s, nullptr, 4);

    if (n % 3 == 0) {
        if (n % 5 == 0)
            ans = "FizzBuzz";
        else
            ans = "Fizz";
    } else if (n % 5 == 0)
        ans = "Buzz";
    return ans;
}
0