結果

問題 No.593 4進FizzBuzz
ユーザー HAHAHAHAHAHA
提出日時 2017-12-20 04:59:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 294 bytes
コンパイル時間 1,630 ms
コンパイル使用メモリ 164,412 KB
実行使用メモリ 8,900 KB
最終ジャッジ日時 2023-08-22 08:54:14
合計ジャッジ時間 5,700 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 1 ms
4,376 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 2 ms
4,376 KB
testcase_16 AC 85 ms
8,276 KB
testcase_17 AC 85 ms
7,256 KB
testcase_18 AC 85 ms
7,484 KB
testcase_19 WA -
testcase_20 AC 86 ms
7,764 KB
testcase_21 AC 86 ms
7,944 KB
testcase_22 WA -
testcase_23 AC 86 ms
8,504 KB
testcase_24 AC 87 ms
8,208 KB
testcase_25 AC 85 ms
7,072 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 86 ms
7,876 KB
testcase_29 WA -
testcase_30 AC 86 ms
8,680 KB
testcase_31 AC 87 ms
7,072 KB
testcase_32 AC 86 ms
8,052 KB
testcase_33 WA -
testcase_34 AC 85 ms
8,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;


bool F(string s, int mod){
	int sum=0;
	for(int i=0;i<s.size();i++){
		sum = (sum*4+s[i]-'0')%mod;
	}
	return sum%mod == 0;
}

int main(){
	string s,s2;
	cin >> s;
	if(F(s,3)) s2+="Fizz";
	if(F(s,5)) s2+="Buzz";
	
	cout << s2 << endl;
	return 0;
}
0