結果
| 問題 |
No.593 4進FizzBuzz
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-25 18:16:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 414 bytes |
| コンパイル時間 | 690 ms |
| コンパイル使用メモリ | 60,544 KB |
| 実行使用メモリ | 9,180 KB |
| 最終ジャッジ日時 | 2024-12-17 20:03:11 |
| 合計ジャッジ時間 | 5,342 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 18 WA * 13 |
ソースコード
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(int argc, char* argv[])
{
string N;
cin>>N;
int i;
int len=N.length()-1;
int m=0;
for (i=len;i>=0;i--){
int n=N[i]-'0';
m+=n*pow(4.0,len-i);
}
if (m%3==0 && m%5==0){
cout<<"FizzBuzz"<<endl;
}else if (m%3==0){
cout<<"Fizz"<<endl;
}else if (m%5==0){
cout<<"Buzz"<<endl;
}else{
cout<<N<<endl;
}
return 0;
}