結果

問題 No.593 4進FizzBuzz
ユーザー e869120e869120
提出日時 2017-11-10 22:26:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 511 bytes
コンパイル時間 818 ms
コンパイル使用メモリ 82,004 KB
実行使用メモリ 8,568 KB
最終ジャッジ日時 2023-08-16 02:58:13
合計ジャッジ時間 3,923 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 51 ms
7,004 KB
testcase_17 AC 51 ms
8,404 KB
testcase_18 AC 51 ms
8,144 KB
testcase_19 AC 52 ms
8,568 KB
testcase_20 AC 51 ms
7,772 KB
testcase_21 AC 51 ms
8,288 KB
testcase_22 AC 52 ms
7,652 KB
testcase_23 AC 51 ms
7,184 KB
testcase_24 AC 51 ms
7,052 KB
testcase_25 AC 51 ms
7,916 KB
testcase_26 AC 52 ms
7,804 KB
testcase_27 AC 53 ms
7,148 KB
testcase_28 AC 51 ms
7,380 KB
testcase_29 AC 53 ms
7,928 KB
testcase_30 AC 51 ms
7,440 KB
testcase_31 AC 51 ms
7,952 KB
testcase_32 AC 51 ms
7,344 KB
testcase_33 AC 51 ms
7,364 KB
testcase_34 AC 51 ms
8,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<functional>
#include<map>
using namespace std;
string S, T;
int main() {
	cin >> S; T = S;
	reverse(S.begin(), S.end());
	int c = 0, d = 1;
	for (int i = 0; i < S.size(); i++) {
		c += (S[i] - '0')*d; d *= 4; d %= 15; c %= 15;
	}
	if (c == 0)cout << "FizzBuzz" << endl;
	else if (c % 3 == 0)cout << "Fizz" << endl;
	else if (c % 5 == 0)cout << "Buzz" << endl;
	else cout << T << endl;
	return 0;
}
0