結果

問題 No.593 4進FizzBuzz
ユーザー dnishdnish
提出日時 2018-06-18 11:42:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 711 bytes
コンパイル時間 1,488 ms
コンパイル使用メモリ 166,712 KB
実行使用メモリ 8,940 KB
最終ジャッジ日時 2023-09-13 06:44:09
合計ジャッジ時間 6,661 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,384 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 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 61 ms
8,004 KB
testcase_17 AC 61 ms
8,612 KB
testcase_18 AC 60 ms
7,488 KB
testcase_19 AC 61 ms
7,348 KB
testcase_20 AC 61 ms
8,412 KB
testcase_21 AC 61 ms
7,940 KB
testcase_22 AC 62 ms
7,112 KB
testcase_23 AC 60 ms
7,540 KB
testcase_24 AC 61 ms
7,528 KB
testcase_25 AC 60 ms
7,296 KB
testcase_26 AC 62 ms
8,740 KB
testcase_27 AC 61 ms
7,940 KB
testcase_28 AC 61 ms
7,180 KB
testcase_29 AC 62 ms
8,940 KB
testcase_30 AC 60 ms
7,920 KB
testcase_31 AC 61 ms
8,184 KB
testcase_32 AC 60 ms
7,280 KB
testcase_33 AC 61 ms
7,484 KB
testcase_34 AC 61 ms
8,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define REP(i,n,N) for(ll i=(n); i<(N); i++)
#define RREP(i,n,N) for(ll i=(N-1); i>=n; i--)
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
#define p2(a,b) cout<<(a)<<" "<<(b)<<endl
typedef long long ll;
using namespace std;
const ll inf=1e18;

string N;
int is3,is5;
int main(){
    cin>>N;
    int n=N.size();
    string M=N;
    reverse(ALL(N));
    REP(i,0,n) {
        is3 += (N[i] - '0');
        is5 += pow(-1, i % 2) * (N[i] - '0');
    }
    if(is3%3==0&&is5%5==0){
        p("FizzBuzz");
    }else if(is3%3==0){
        p("Fizz");
    }else if(is5%5==0){
        p("Buzz");
    }else{
        p(M);
    }
    return 0;
}
0