結果
| 問題 |
No.8022 縛りFizzBuzz (Easy)
|
| コンテスト | |
| ユーザー |
Lepton_s
|
| 提出日時 | 2018-02-21 18:32:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,368 bytes |
| コンパイル時間 | 1,219 ms |
| コンパイル使用メモリ | 114,592 KB |
| 最終ジャッジ日時 | 2025-01-05 08:24:51 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
#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;
}
Lepton_s