結果

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

ソースコード

diff #

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

using namespace std;

int main()
{
  string n;
  cin >> n;
  long long 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;
  cout << endl;

  return 0;
}
0