結果

問題 No.593 4進FizzBuzz
ユーザー BantakoBantako
提出日時 2018-05-27 23:28:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 1,732 ms
コンパイル使用メモリ 166,268 KB
実行使用メモリ 8,668 KB
最終ジャッジ日時 2023-09-12 19:45:24
合計ジャッジ時間 6,160 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 2 ms
4,384 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 48 ms
8,212 KB
testcase_17 AC 47 ms
7,236 KB
testcase_18 AC 47 ms
7,028 KB
testcase_19 AC 49 ms
7,020 KB
testcase_20 AC 48 ms
7,708 KB
testcase_21 AC 48 ms
8,412 KB
testcase_22 AC 48 ms
7,896 KB
testcase_23 AC 48 ms
7,232 KB
testcase_24 AC 47 ms
8,160 KB
testcase_25 AC 48 ms
8,160 KB
testcase_26 AC 48 ms
7,016 KB
testcase_27 AC 48 ms
6,916 KB
testcase_28 AC 48 ms
7,164 KB
testcase_29 AC 48 ms
7,692 KB
testcase_30 AC 48 ms
8,668 KB
testcase_31 AC 47 ms
8,216 KB
testcase_32 AC 48 ms
7,164 KB
testcase_33 AC 48 ms
7,904 KB
testcase_34 AC 48 ms
7,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    string S;
    cin >> S;
    int num = 0,odd = S.size() & 1;
    for(int i = S.size()-1;i >= 0;i--){
        int n = (S[i] - '0') * (odd ^ (i&1) ? 1 : 4);
        num = (num + n) % 15;
    }
    if(num == 0)cout << "FizzBuzz" << endl;
    else if(num % 3 == 0)cout << "Fizz" << endl;
    else if(num % 5 == 0)cout << "Buzz" << endl;
    else    cout << S << endl;
}
0