結果
| 問題 |
No.8022 縛りFizzBuzz (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-31 22:45:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 631 bytes |
| コンパイル時間 | 567 ms |
| コンパイル使用メモリ | 73,744 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 05:01:17 |
| 合計ジャッジ時間 | 1,057 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
typedef long long int ll;
using namespace std;
int N,a,b;
int one;
#define EREP(i,zero,n) for (int i=(zero);i<=(n);i++)
int main(){
ios_base::sync_with_stdio(false);
cin>>N;
a++;
a++;
a++;
b++;
b++;
b++;
b++;
b++;
one++;
EREP(i,one,N){
if(!(i%a)&&(i%b))cout<<"Fizz"<<endl;
if(!(i%b)&&(i%a))cout<<"Buzz"<<endl;
if(!(i%b)&&!(i%a))cout<<"FizzBuzz"<<endl;
if((i%a)&&(i%b))cout<<i<<endl;
}
}