結果

問題 No.593 4進FizzBuzz
ユーザー Mayimg
提出日時 2019-01-22 12:07:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 455 bytes
コンパイル時間 1,446 ms
コンパイル使用メモリ 165,976 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-15 13:31:40
合計ジャッジ時間 3,365 ms
ジャッジサーバーID
(参考情報)
judge6 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	int res = 0;
	int m = n;
	for (int i = 0; n; i++) {
		res += pow(4, i) * (n % 10);
		n /= 10;
	}
	if (res % 15 == 0) {
		cout << "FizzBuzz" << endl;
	} else if (res % 3 == 0) {
		cout << "Fizz" << endl;
	} else if (res % 5 == 0) {
		cout << "Buzz" << endl;
	} else {
		cout << m << endl;
	}
	return 0;	
}
0