結果

問題 No.3022 縛りFizzBuzz (Easy)
ユーザー rsk0315rsk0315
提出日時 2020-02-24 21:07:37
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 507 bytes
コンパイル時間 466 ms
コンパイル使用メモリ 58,212 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 16:44:09
合計ジャッジ時間 1,228 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <string>

#define length(x) ((#x ## s).length())

using namespace std::literals;

int const one = length(x);
int const three = length(xxx);
int const five = length(xxxxx);

int main() {
  int n;
  scanf("%d", &n);

  for (int i = one; i <= n; ++i) {
    if ((i % three < one) && (i % five < one)) {
      puts("FizzBuzz");
    } else if (i % three < one) {
      puts("Fizz");
    } else if (i % five < one) {
      puts("Buzz");
    } else {
      printf("%d\n", i);
    }
  }
}
0