結果

問題 No.593 4進FizzBuzz
ユーザー aim_cpo
提出日時 2018-02-23 22:14:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 1,542 ms
コンパイル使用メモリ 166,844 KB
実行使用メモリ 9,292 KB
最終ジャッジ日時 2024-10-09 17:30:44
合計ジャッジ時間 4,743 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;

string s;

int main(){
  cin>>s;
  int n=(int)s.size();
  ll sum=0;
  ll now=1;
  for(int i=n-1;i>=0;i--){
    sum+=now*(int)(s[i]-'0');
    now*=4;
  }
  if(sum%3==0 && sum%5==0)cout<<"FizzBuzz"<<"\n";
  else if(sum%3==0)cout<<"Fizz"<<"\n";
  else if(sum%5==0)cout<<"Buzz"<<"\n";
  else cout<<s<<"\n";
  return 0;
}
0