結果
問題 |
No.593 4進FizzBuzz
|
ユーザー |
|
提出日時 | 2017-12-25 18:28:39 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 421 bytes |
コンパイル時間 | 454 ms |
コンパイル使用メモリ | 55,720 KB |
実行使用メモリ | 9,052 KB |
最終ジャッジ日時 | 2024-12-17 20:09:12 |
合計ジャッジ時間 | 3,461 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 WA * 12 |
ソースコード
#include <iostream> #include <string> using namespace std; typedef long long LL; int main(int argc, char* argv[]) { string N; cin>>N; int i; int len=N.length()-1; LL M=0; LL m=1; for (i=len;i>=0;i--){ int n=N[i]-'0'; M+=n*m; m*=4; } 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; }