結果
問題 | No.8022 縛りFizzBuzz (Easy) |
ユーザー |
![]() |
提出日時 | 2021-09-09 21:55:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 784 bytes |
コンパイル時間 | 4,099 ms |
コンパイル使用メモリ | 228,568 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-31 09:40:36 |
合計ジャッジ時間 | 4,899 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif using ll = long long; using ld = long double; #define endl "\n" #define rep(i,a,b) for(int i=a;i<b;i++) #define rrep(i,a,b) for(int i=a;i>=b;i--) #define fore(i,a) for(auto &i:a) #define all(x) (x).begin(),(x).end() #define del(x) sort(all(x)); x.erase(unique(all(x)),x.end()); int main(){ ll n; cin >> n; ll zero='a'-'a'; ll one='b'-'a'; ll three='d'-'a'; ll five='f'-'a'; rep(i,one,n+one){ if(i%three==zero && i%five==zero){ cout << "FizzBuzz"<<endl; } else if(i%three==zero){ cout << "Fizz"<<endl; } else if(i%five==zero){ cout << "Buzz"<<endl; } else{ cout << i << endl; } } }