結果

問題 No.593 4進FizzBuzz
ユーザー HIR180HIR180
提出日時 2017-11-10 22:38:27
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 929 bytes
コンパイル時間 1,270 ms
コンパイル使用メモリ 159,304 KB
実行使用メモリ 9,016 KB
最終ジャッジ日時 2024-05-03 12:52:43
合計ジャッジ時間 3,561 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,948 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 1 ms
6,944 KB
testcase_16 AC 38 ms
7,184 KB
testcase_17 AC 38 ms
9,016 KB
testcase_18 AC 38 ms
8,192 KB
testcase_19 AC 39 ms
7,648 KB
testcase_20 AC 39 ms
7,184 KB
testcase_21 AC 38 ms
8,492 KB
testcase_22 AC 38 ms
7,308 KB
testcase_23 AC 38 ms
7,956 KB
testcase_24 AC 38 ms
7,432 KB
testcase_25 AC 39 ms
7,608 KB
testcase_26 AC 40 ms
7,584 KB
testcase_27 AC 39 ms
8,428 KB
testcase_28 AC 42 ms
8,852 KB
testcase_29 AC 38 ms
7,188 KB
testcase_30 AC 39 ms
8,200 KB
testcase_31 AC 37 ms
8,736 KB
testcase_32 AC 37 ms
7,752 KB
testcase_33 AC 39 ms
7,848 KB
testcase_34 AC 39 ms
7,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

int main(){
	string s; cin>>s;
	int n = s.size();
	int x = 0,y = 0,c = 0;
	for(int i=n-1;i>=0;i--){
		if(c%2 == 0){
			x += (s[i]-'0');
			y += (s[i]-'0');
		}
		else{
			x += (s[i]-'0');
			y -= (s[i]-'0');
		}
		c++;
	}x%=3;y%=5;
	if(x==0&&y==0)puts("FizzBuzz");
	else if(x==0) puts("Fizz");
	else if(y==0) puts("Buzz");
	else cout<<s<<endl;
}
0