結果
問題 | No.593 4進FizzBuzz |
ユーザー | akusyounin2412 |
提出日時 | 2017-11-10 22:58:28 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,177 bytes |
コンパイル時間 | 1,194 ms |
コンパイル使用メモリ | 116,176 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-24 13:15:42 |
合計ジャッジ時間 | 3,232 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,820 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 1 ms
6,816 KB |
testcase_04 | AC | 1 ms
6,816 KB |
testcase_05 | AC | 2 ms
6,820 KB |
testcase_06 | AC | 1 ms
6,820 KB |
testcase_07 | AC | 1 ms
6,816 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 2 ms
6,820 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 2 ms
6,816 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
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; m = n; 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; }