結果
| 問題 |
No.8022 縛りFizzBuzz (Easy)
|
| コンテスト | |
| ユーザー |
algon_320
|
| 提出日時 | 2017-03-31 22:38:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 617 bytes |
| コンパイル時間 | 1,633 ms |
| コンパイル使用メモリ | 168,520 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-07 04:58:13 |
| 合計ジャッジ時間 | 1,820 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
string zero="";
string one="#";
string two="##";
string three="###";
string five="#####";
for(int i=one.size();i<N+one.size();i++) {
if(i%three.size()==zero.size() && i%five.size()==zero.size()) {
cout<<"FizzBuzz"<<endl;
}
else if(i%three.size()==zero.size()) {
cout<<"Fizz"<<endl;
}
else if(i%five.size()==zero.size()) {
cout<<"Buzz"<<endl;
}
else {
cout<<i<<endl;
}
}
return zero.size();
}
algon_320