結果

問題 No.3022 縛りFizzBuzz (Easy)
ユーザー Lepton_sLepton_s
提出日時 2018-02-21 18:32:32
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,368 bytes
コンパイル時間 1,056 ms
コンパイル使用メモリ 117,424 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 02:19:27
合計ジャッジ時間 2,142 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<P,ll> PPI;
typedef pair<ll,P> PIP;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vp;
#define PQ(T) priority_queue<T,vector<T>,greater<T>>
#define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) ((x)=min((x),(y)))
#define chmax(x,y) ((x)=max((x),(y)))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())

int a, b, c, d, e, f, g;

int main(){
	b++;
	c=b;c++;
	d=c;d++;
	e=d;e++;
	f=e;f++;
	int n;
	cin>>n;
	while(++g<=n){
		bool th = !(g%d);
		bool fv = !(g%f);
		if(th){
			if(fv) cout<<"FizzBuzz"<<endl;
			else cout<<"Fizz"<<endl;
		} else if(fv) cout<<"Buzz"<<endl;
		else cout<<g<<endl;
	}
	return a;
}
0