結果

問題 No.593 4進FizzBuzz
ユーザー gotutiyangotutiyan
提出日時 2018-05-28 09:37:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 991 bytes
コンパイル時間 806 ms
コンパイル使用メモリ 80,856 KB
実行使用メモリ 9,008 KB
最終ジャッジ日時 2023-09-12 19:54:28
合計ジャッジ時間 4,175 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 37 ms
7,732 KB
testcase_19 WA -
testcase_20 AC 37 ms
7,180 KB
testcase_21 AC 37 ms
8,420 KB
testcase_22 AC 38 ms
8,132 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 39 ms
8,680 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 39 ms
7,928 KB
testcase_30 AC 38 ms
7,012 KB
testcase_31 WA -
testcase_32 AC 39 ms
6,960 KB
testcase_33 AC 39 ms
7,008 KB
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF INT_MAX
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    string s;
    cin>>s;
    ll ans=0;
    rep(i,0,s.size()){
        ans+=pow(4,i)*(s[s.size()-i-1]-'0');
        if(i==15)break;
    }
    if(ans%3&&ans%5)cout<<s;
    else {
        if(ans%3==0)cout<<"Fizz";
        if(ans%5==0)cout<<"Buzz";
    }
    cout<<endl;
    return 0;
}
0