結果
問題 | No.593 4進FizzBuzz |
ユーザー | akusyounin2412 |
提出日時 | 2017-11-10 22:49:41 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,177 bytes |
コンパイル時間 | 1,063 ms |
コンパイル使用メモリ | 114,912 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 13:05:47 |
合計ジャッジ時間 | 3,397 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 2 ms
5,248 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 2 ms
5,248 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 53 ms
5,248 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 55 ms
5,248 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 53 ms
5,248 KB |
testcase_29 | WA | - |
testcase_30 | AC | 53 ms
5,248 KB |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
ソースコード
# include <iostream> # include <algorithm> # include <vector> # include <string> # include <set> # include <map> # include <cmath> # include <iomanip> # include <functional> # include <tuple> # include <utility> # include <stack> # include <queue> # include <list> # include <bitset> # include <complex> # include <chrono> # include <random> # include <limits.h> # include <unordered_map> # include <unordered_set> # include <deque> # include <cstdio> # include <cstring> using namespace std; using LL = long long; using ULL = unsigned long long; constexpr long long MOD = 1000000000 + 7; constexpr long long INF = 1e17 - 10; const double PI = acos(-1); typedef pair<LL, LL> Pll; LL n, m, a[1000000] = {}, sum, ans = 0; bitset<10000>bi[10] = {}; string st[2]; int main() { cin >> n; n = m; bool fb[2] = {}, FF = 1; if (n % 3 == 0)fb[0] = 1; while (1) { if (n != 0) { sum += (sum + (FF == 1 ? n % 10 : (n % 10) * 4)) % 5; FF = !FF; n = n / 10; } else break; } if (sum % 5 == 0)fb[1] = 1; if (fb[0] == 0 && fb[1] == 0) cout << m << endl; else cout << (fb[0] == 1 ? (fb[1] == 1 ? "FizzBuzz" : "Fizz") : (fb[1] == 1 ? "Buzz" : "")) << endl; return 0; }