結果
問題 | No.8022 縛りFizzBuzz (Easy) |
ユーザー |
|
提出日時 | 2020-03-25 13:38:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 752 ms |
コンパイル使用メモリ | 91,404 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-01 20:29:00 |
合計ジャッジ時間 | 1,668 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
ソースコード
#include <iostream> #include <algorithm> #include <iomanip> #include <map> #include <set> #include <queue> #include <stack> #include <numeric> #include <bitset> #include <cmath> using namespace std; int main() { int n; cin >> n; int one = int(), zero = one++; int three = one+one+one, five = three+one+one; for (int i = one; i <= n; ++i) { string ans; if(!(i%three)) ans += "Fizz"; if(!(i%five)) ans += "Buzz"; cout << (ans.size() ? ans : to_string(i)) << "\n"; } return zero; }