結果

問題 No.593 4進FizzBuzz
ユーザー yuruhiyayuruhiya
提出日時 2019-04-01 17:00:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 964 bytes
コンパイル時間 1,913 ms
コンパイル使用メモリ 166,620 KB
実行使用メモリ 8,988 KB
最終ジャッジ日時 2023-08-16 18:57:31
合計ジャッジ時間 5,670 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 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 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 40 ms
8,024 KB
testcase_17 AC 40 ms
7,756 KB
testcase_18 AC 39 ms
7,496 KB
testcase_19 AC 41 ms
6,984 KB
testcase_20 AC 41 ms
7,948 KB
testcase_21 AC 39 ms
7,692 KB
testcase_22 AC 42 ms
8,220 KB
testcase_23 AC 40 ms
7,496 KB
testcase_24 AC 39 ms
7,764 KB
testcase_25 AC 41 ms
8,712 KB
testcase_26 AC 41 ms
7,616 KB
testcase_27 AC 41 ms
7,956 KB
testcase_28 AC 40 ms
7,192 KB
testcase_29 AC 41 ms
6,904 KB
testcase_30 AC 41 ms
7,620 KB
testcase_31 AC 40 ms
8,812 KB
testcase_32 AC 41 ms
7,240 KB
testcase_33 AC 42 ms
8,988 KB
testcase_34 AC 41 ms
7,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = 1e9;
const double pi = acos(-1.0);

int main() {
	string n; cin >> n;
	reverse(all(n));
	int sum = 0;
	rep(i, sz(n)) {
		sum += (n[i] - '0')*(i % 2 == 0 ? 1 : 4);
	}

	if (sum % 15 == 0) {
		puts("FizzBuzz");
	}
	else if (sum % 3 == 0) {
		puts("Fizz");
	}
	else if (sum % 5 == 0) {
		puts("Buzz");
	}
	else {
		reverse(all(n));
		Cout(n);
	}
}
0