結果
問題 | No.593 4進FizzBuzz |
ユーザー | akusyounin2412 |
提出日時 | 2017-11-10 23:05:01 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,176 bytes |
コンパイル時間 | 1,371 ms |
コンパイル使用メモリ | 104,044 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 13:45:13 |
合計ジャッジ時間 | 4,095 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,248 KB |
testcase_03 | AC | 1 ms
5,248 KB |
testcase_04 | AC | 2 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 1 ms
5,248 KB |
testcase_07 | AC | 2 ms
5,248 KB |
testcase_08 | AC | 2 ms
5,248 KB |
testcase_09 | AC | 1 ms
5,248 KB |
testcase_10 | AC | 1 ms
5,248 KB |
testcase_11 | AC | 2 ms
5,248 KB |
testcase_12 | AC | 2 ms
5,248 KB |
testcase_13 | AC | 2 ms
5,248 KB |
testcase_14 | AC | 2 ms
5,248 KB |
testcase_15 | AC | 2 ms
5,248 KB |
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; }