結果

問題 No.593 4進FizzBuzz
ユーザー ceni1055
提出日時 2018-12-20 00:19:10
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 1,440 ms
コンパイル使用メモリ 167,500 KB
実行使用メモリ 9,144 KB
最終ジャッジ日時 2024-09-25 08:17:23
合計ジャッジ時間 5,227 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <assert.h>

using namespace std;

int main()
{
  string n;
  cin >> n;
  int tmp = 0, dig = 1;
  for (int i = n.size() - 1; - 1 < i; i--)
  {
    tmp += dig * (n[i] - '0');
    dig *= 4;
  }
  if (tmp % 3 == 0)
    cout << "Fizz";
  if (tmp % 5 == 0)
    cout << "Buzz";
  if (tmp % 3 != 0 && tmp % 5 != 0)
    cout << n << endl;
    
  return 0;
}
0