結果

問題 No.3022 縛りFizzBuzz (Easy)
ユーザー hanorverhanorver
提出日時 2017-03-31 23:18:14
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 525 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 77,488 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 11:29:12
合計ジャッジ時間 1,656 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>




int main() {
	int n;

	std::cin >> n;

	int five = true + true + true + true + true;
	int three = true + true + true;

	for (int i = true; i <= n; i++)
	{
		if (!(i % three)) {
			if (!(i % five)) {
				std::cout << "FizzBuzz" << std::endl;
			} else {
				std::cout << "Fizz" << std::endl;
			}
		} else if (!(i % five)) {
			std::cout << "Buzz" << std::endl;
		} else {
			std::cout << i << std::endl;
		}
	}
}
0