結果

問題 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,769 ms
コンパイル使用メモリ 144,196 KB
実行使用メモリ 8,288 KB
最終ジャッジ日時 2023-08-16 03:18:53
合計ジャッジ時間 4,748 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,384 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 42 ms
7,908 KB
testcase_17 AC 42 ms
6,864 KB
testcase_18 AC 42 ms
7,040 KB
testcase_19 AC 42 ms
7,072 KB
testcase_20 AC 41 ms
7,640 KB
testcase_21 AC 41 ms
7,400 KB
testcase_22 AC 41 ms
7,384 KB
testcase_23 AC 41 ms
8,288 KB
testcase_24 AC 41 ms
7,596 KB
testcase_25 AC 41 ms
7,848 KB
testcase_26 AC 42 ms
7,588 KB
testcase_27 AC 41 ms
7,780 KB
testcase_28 AC 41 ms
7,376 KB
testcase_29 AC 42 ms
7,056 KB
testcase_30 AC 41 ms
7,892 KB
testcase_31 AC 42 ms
7,292 KB
testcase_32 AC 41 ms
7,644 KB
testcase_33 AC 42 ms
7,876 KB
testcase_34 AC 40 ms
7,548 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