結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー 友利奈緒友利奈緒
提出日時 2015-03-21 02:36:27
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 886 bytes
コンパイル時間 2,175 ms
コンパイル使用メモリ 144,104 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 09:11:11
合計ジャッジ時間 1,796 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)
const double eps = 1e-10;
const double pi = acos(-1.0);
const double inf = (int)1e8;

int main(){
  long long a;
  cin >> a;
  loop(i,1,a+1){
    if(i%3==0&&i%5==0) cout <<"FizzBuzz"<<endl;
    else if(i%3==0) cout << "Fizz" << endl;
    else if(i%5==0) cout << "Buzz" << endl;
    else cout << i << endl;
  }
}
0