結果
| 問題 |
No.9002 FizzBuzz(テスト用)
|
| ユーザー |
keishi7773
|
| 提出日時 | 2021-04-24 18:50:32 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,762 bytes |
| コンパイル時間 | 1,326 ms |
| コンパイル使用メモリ | 136,664 KB |
| 実行使用メモリ | 6,940 KB |
| 最終ジャッジ日時 | 2024-07-04 09:10:48 |
| 合計ジャッジ時間 | 1,732 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
// #include <bits/stdc++.h>
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cmath>
#include <limits>
#include <stdio.h>
#include <string.h>
#include <numeric>
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))
#define rep(i, a, b) for (int i = a; i < b; i++)
const long long INF = 1LL << 60;
typedef long long ll;
template <class T>
inline bool chmin(T &a, T b)
{
if (a > b)
{
a = b;
return true;
}
return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
if (a < b)
{
a = b;
return true;
}
return false;
}
#define all(x) (x).begin(), (x).end()
using namespace std;
// 上下左右の移動用配列
// セットで上、右、下、左の順番
int dx[4] = {0, 1, 0, -1};
int dy[4] = {-1, 0, 1, 0};
int main(int, char **)
{
int N;
cin >> N;
for (int i = 1; i <= N; i++)
{
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;
}
}
return 0;
}
keishi7773