Submission #00003


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include<bits/stdc++.h>
#define ll long long
#define fir first
#define sec second
#define np(v) next_permutation(v.begin(),v.end()) //次の順列
#define gcd(a,b) __gcd(a,b) //最大公約数
#define lcm(a,b) a*b/(gcd(a,b)) //最小公倍数
#define lb(v,a) lower_bound(v.begin(),v.end(),a)
#define ub(v,a) upper_bound(v.begin(),v.end(),a)
#define bs(v,a) binary_search(v.begin(),v.end(),a)
#define bitcount(i) __builtin_popcount(i)
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int x,a,b;
cin>>x>>a>>b;
for(int i = 1;i <= x;i++){
if(a&&b&&i%a == 0&&i%b == 0){
cout<<"FizzBuzz\n";
}else if(a&&i%a == 0){
cout<<"Fizz\n";
}else if(b&&i%b == 0){
cout<<"Buzz\n";
}else{
cout<<i<<"\n";
}
}
return(0);
}

ステータス

項目 データ
問題 0013 - Extension FizzBuzz
ユーザー名 r2213
投稿日時 2023-07-18 16:03:44
言語 C++17
状態 Accepted
得点 100
ソースコード長 877 Byte
最大実行時間 68 ms
最大メモリ使用量 30052 KB

セット

セット 得点 Cases
1 ALL 100 / 100 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01 AC 24 ms 476 KB
1
in02 AC 21 ms 436 KB
1
in03 AC 17 ms 520 KB
1
in04 AC 23 ms 472 KB
1
in05 AC 21 ms 552 KB
1
in06 AC 16 ms 632 KB
1
in07 AC 20 ms 588 KB
1
in08 AC 15 ms 668 KB
1
in09 AC 20 ms 752 KB
1
in10 AC 32 ms 832 KB
1
in11 AC 27 ms 1172 KB
1
in12 AC 46 ms 4452 KB
1
in13 AC 68 ms 9008 KB
1
in14 AC 42 ms 11264 KB
1
in15 AC 28 ms 12240 KB
1
in16 AC 48 ms 15648 KB
1
in17 AC 65 ms 21232 KB
1
in18 AC 58 ms 25788 KB
1
in19 AC 37 ms 27152 KB
1
in20 AC 47 ms 30052 KB
1