結果

問題 No.593 4進FizzBuzz
ユーザー jimmyo0705jimmyo0705
提出日時 2017-11-10 23:30:45
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,383 bytes
コンパイル時間 633 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 24,584 KB
最終ジャッジ日時 2024-05-03 14:40:59
合計ジャッジ時間 3,635 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 45 ms
22,784 KB
testcase_17 WA -
testcase_18 AC 45 ms
22,868 KB
testcase_19 AC 47 ms
24,116 KB
testcase_20 WA -
testcase_21 AC 45 ms
24,404 KB
testcase_22 AC 47 ms
23,104 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 46 ms
23,200 KB
testcase_27 AC 46 ms
24,584 KB
testcase_28 WA -
testcase_29 AC 46 ms
23,756 KB
testcase_30 AC 47 ms
22,916 KB
testcase_31 AC 46 ms
23,512 KB
testcase_32 AC 45 ms
24,228 KB
testcase_33 AC 45 ms
23,056 KB
testcase_34 AC 46 ms
23,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100

string s;
ll ans[2001000];

bool isf() {
	if (s.size() == 1)return false;
	rep(i, s.size() - 1) {
		ans[i + 1] -= ans[i];
	}
	return ans[s.size() - 1] == 0;
}

bool ist(string s) {
	ll res = 0;
	rep(i, s.size()) {
		res += (ll)(s[i] - '0');
	}
	return res % 3 == 0;
}

int main() {
	cin >> s;
	rep(i, s.size()) {
		ans[i] = s[i] - '0';
	}
	if (ist(s)) {
		if (isf())cout << "FizzBuzz" << endl;
		else cout << "Fizz" << endl;
	}
	else if (isf()) cout << "Buzz" << endl;
	else cout << s << endl;
}
0