結果
問題 |
No.593 4進FizzBuzz
|
ユーザー |
![]() |
提出日時 | 2019-04-01 17:00:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 48 ms / 2,000 ms |
コード長 | 964 bytes |
コンパイル時間 | 1,852 ms |
コンパイル使用メモリ | 168,620 KB |
実行使用メモリ | 7,352 KB |
最終ジャッジ日時 | 2024-11-25 08:36:21 |
合計ジャッジ時間 | 4,784 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 31 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" using namespace std; #define rep(i, n) for(int i=0; i<(n); ++i) #define FOR(i, m, n) for(int i=(m); i<(n); ++i) #define sz(x) ((int)(x).size()) #define all(x) (x).begin(),(x).end() #define mp make_pair #define pb push_back #define Cout(x) cout << (x) << endl #define Cout2(x, y) cout << (x) << " " << (y) << endl #define dump(x) cerr << #x << " = " << (x) << endl; typedef long long LL; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<string> VS; typedef vector<bool> VB; typedef vector<vector<int>> VVI; typedef pair<int, int> PII; const int inf = 1e9; const double pi = acos(-1.0); int main() { string n; cin >> n; reverse(all(n)); int sum = 0; rep(i, sz(n)) { sum += (n[i] - '0')*(i % 2 == 0 ? 1 : 4); } if (sum % 15 == 0) { puts("FizzBuzz"); } else if (sum % 3 == 0) { puts("Fizz"); } else if (sum % 5 == 0) { puts("Buzz"); } else { reverse(all(n)); Cout(n); } }