結果

問題 No.593 4進FizzBuzz
ユーザー ohreitetsuohreitetsu
提出日時 2017-11-12 20:03:15
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 52,648 KB
実行使用メモリ 8,952 KB
最終ジャッジ日時 2023-08-16 11:00:43
合計ジャッジ時間 3,490 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 40 ms
8,084 KB
testcase_19 AC 41 ms
7,148 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 41 ms
8,104 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 41 ms
7,748 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 40 ms
7,940 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 39 ms
7,660 KB
testcase_33 AC 41 ms
7,312 KB
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
typedef long long LL;
int main(int argc, char* argv[])
{
	string s;
	cin>>s;
	int sLen=s.length();
	LL v=0;
	int i;
	LL pow4=1;
	for (i=sLen-1;i>=0;i--){
		v+=(s[i]-'0')*pow4;
		pow4*=4;
	}
	if (v%3==0 && v%5!=0){
		cout<<"Fizz"<<endl;
	}else if (v%3!=0 && v%5==0){
		cout<<"Buzz"<<endl;
	}else if (v%3==0 && v%5==0){
		cout<<"FizzBuzz"<<endl;
	}else{
		cout<<s<<endl;
	}
	return 0;
}
0