結果

問題 No.593 4進FizzBuzz
ユーザー akusyounin2412akusyounin2412
提出日時 2017-11-10 23:22:39
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,361 bytes
コンパイル時間 901 ms
コンパイル使用メモリ 105,672 KB
実行使用メモリ 13,108 KB
最終ジャッジ日時 2024-05-03 14:35:21
合計ジャッジ時間 3,361 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
7,104 KB
testcase_01 AC 3 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 3 ms
6,944 KB
testcase_10 WA -
testcase_11 AC 4 ms
6,944 KB
testcase_12 AC 3 ms
7,004 KB
testcase_13 AC 3 ms
6,940 KB
testcase_14 AC 3 ms
7,352 KB
testcase_15 AC 3 ms
6,944 KB
testcase_16 AC 51 ms
11,320 KB
testcase_17 AC 50 ms
10,012 KB
testcase_18 AC 50 ms
11,900 KB
testcase_19 WA -
testcase_20 AC 51 ms
11,900 KB
testcase_21 AC 51 ms
11,316 KB
testcase_22 WA -
testcase_23 AC 51 ms
11,456 KB
testcase_24 AC 51 ms
10,956 KB
testcase_25 AC 50 ms
10,212 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 50 ms
10,908 KB
testcase_29 WA -
testcase_30 AC 50 ms
10,076 KB
testcase_31 AC 51 ms
10,520 KB
testcase_32 AC 50 ms
10,688 KB
testcase_33 WA -
testcase_34 AC 51 ms
11,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1e17 - 10;
const double PI = acos(-1);
typedef pair<LL, LL> Pll;
LL n, m, a[1000000] = {}, sum, ans = 0, d[1000000] = {};
bitset<10000>bi[10] = {};
struct edge { LL to, cost; };
vector<edge>vec[100000];
string st[2],str;
int main() {
	cin >> str;
	bool fb[2] = {}, FF = 1;
	for (int i = 0; i < str.size(); i++) {
		sum += str[i] - '0';
	}
	if (sum % 3 == 0)fb[0] = 1;
	LL i = 0; sum = 0;
	while (1) {
		if (i < str.size()) {
			int num = (str[i] - '0');
			sum = (sum + (FF == 1 ? num % 10 : num * 4)) % 5;
			FF = !FF;
			i++;
		}
		else break;
	}
	if (sum % 5 == 0)fb[1] = 1;
	if (fb[0] == 0 && fb[1] == 0)
		cout << m << endl;
	else
		cout << (fb[0] == 1 ? (fb[1] == 1 ? "FizzBuzz" : "Fizz") : (fb[1] == 1 ? "Buzz" : "")) << endl;
	return 0;
}
0