結果

問題 No.593 4進FizzBuzz
ユーザー Mayimg
提出日時 2019-01-22 12:21:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 486 bytes
コンパイル時間 1,670 ms
コンパイル使用メモリ 166,408 KB
実行使用メモリ 5,484 KB
最終ジャッジ日時 2024-09-15 13:31:45
合計ジャッジ時間 4,513 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
string s;
bool div(int x) {
	int c = 0;
	for (int i = 0; i < (int) s.length(); i++) {
		c = 10 * c + s[i] - '0';
		c %= x;
	}
	return c == 0;
}
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> s;
	if (div(3) && div(11)) {
		cout << "FizzBuzz" << endl;
	} else if (div(3)) {
		cout << "Fizz" << endl;
	} else if (div(11)) {
		cout << "Buzz" << endl;
	} else {
		cout << s << endl;
	}
	return 0;	
}
0