結果

問題 No.593 4進FizzBuzz
ユーザー kurenai3110kurenai3110
提出日時 2017-11-10 23:34:42
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 63,172 KB
実行使用メモリ 8,792 KB
最終ジャッジ日時 2023-08-16 05:31:10
合計ジャッジ時間 3,473 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 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,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 42 ms
6,900 KB
testcase_17 AC 44 ms
7,712 KB
testcase_18 AC 44 ms
7,496 KB
testcase_19 AC 43 ms
6,892 KB
testcase_20 AC 45 ms
6,952 KB
testcase_21 AC 44 ms
7,396 KB
testcase_22 AC 46 ms
8,540 KB
testcase_23 AC 45 ms
7,096 KB
testcase_24 AC 45 ms
7,900 KB
testcase_25 AC 45 ms
7,700 KB
testcase_26 AC 46 ms
8,792 KB
testcase_27 AC 46 ms
6,900 KB
testcase_28 AC 43 ms
7,704 KB
testcase_29 AC 45 ms
7,940 KB
testcase_30 AC 43 ms
7,956 KB
testcase_31 AC 44 ms
8,524 KB
testcase_32 AC 45 ms
6,932 KB
testcase_33 AC 44 ms
7,212 KB
testcase_34 AC 46 ms
7,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;

#define MOD (int)(1e9+7);

int main()
{
	string SN; cin >> SN;
	int N = 0;
	int is3 = 0;
	for (int i = 0; i < SN.size(); i++) {
		N *= 4;
		N += SN[i] - '0';
		is3 += SN[i] - '0';
		N %= 10;
	}

	if ((N == 0 || N == 5) && is3 % 3 == 0)cout << "FizzBuzz" << endl;
	else if (is3 % 3 == 0)cout << "Fizz" << endl;
	else if ((N == 0 || N == 5))cout << "Buzz" << endl;
	else cout << SN << endl;

	return 0;
}

0