結果

問題 No.593 4進FizzBuzz
ユーザー polylogKpolylogK
提出日時 2017-11-10 22:54:53
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 690 bytes
コンパイル時間 1,636 ms
コンパイル使用メモリ 164,020 KB
実行使用メモリ 8,952 KB
最終ジャッジ日時 2023-08-16 03:33:29
合計ジャッジ時間 4,521 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 47 ms
7,408 KB
testcase_17 AC 50 ms
7,392 KB
testcase_18 AC 47 ms
7,676 KB
testcase_19 AC 49 ms
7,000 KB
testcase_20 AC 47 ms
8,452 KB
testcase_21 AC 48 ms
7,884 KB
testcase_22 AC 47 ms
7,408 KB
testcase_23 AC 47 ms
7,412 KB
testcase_24 AC 48 ms
7,408 KB
testcase_25 AC 49 ms
8,176 KB
testcase_26 AC 49 ms
7,968 KB
testcase_27 AC 48 ms
6,868 KB
testcase_28 AC 51 ms
7,100 KB
testcase_29 AC 49 ms
8,668 KB
testcase_30 AC 49 ms
8,952 KB
testcase_31 AC 47 ms
7,004 KB
testcase_32 AC 50 ms
6,884 KB
testcase_33 AC 50 ms
8,256 KB
testcase_34 AC 48 ms
7,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
#define pq priotity_queue
#define P pair<int,int>
#define P2 pair<int,P>
#define P3 pair<int,P2>
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const ld PI=abs(acos(-1));
int n,li[200010]={};
string s;

int main(){
	cin >> s;
	int three=0, five=0;
	REP(i,0,s.size()) (three+=s[i]-'0')%=3;
	REP(i,0,s.size()){
		if(i%2) (five+=-(s[i]-'0'))%=5;
		else (five+=s[i]-'0')%=5;
	}
	
	if(three and five) cout << s;
	if(!three) cout << "Fizz";
	if(!five) cout << "Buzz";
	cout << endl;
	return 0;
}
0