結果
問題 | No.593 4進FizzBuzz |
ユーザー | akusyounin2412 |
提出日時 | 2017-11-10 23:22:39 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,361 bytes |
コンパイル時間 | 1,070 ms |
コンパイル使用メモリ | 105,800 KB |
実行使用メモリ | 9,532 KB |
最終ジャッジ日時 | 2024-11-24 15:25:57 |
合計ジャッジ時間 | 3,838 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 4 ms
5,760 KB |
testcase_01 | AC | 4 ms
5,632 KB |
testcase_02 | AC | 4 ms
5,632 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 4 ms
5,760 KB |
testcase_08 | AC | 4 ms
5,760 KB |
testcase_09 | AC | 4 ms
5,632 KB |
testcase_10 | WA | - |
testcase_11 | AC | 3 ms
5,760 KB |
testcase_12 | AC | 4 ms
5,760 KB |
testcase_13 | AC | 4 ms
5,760 KB |
testcase_14 | AC | 4 ms
5,760 KB |
testcase_15 | AC | 4 ms
5,760 KB |
testcase_16 | AC | 52 ms
9,528 KB |
testcase_17 | AC | 52 ms
9,400 KB |
testcase_18 | AC | 51 ms
9,528 KB |
testcase_19 | WA | - |
testcase_20 | AC | 52 ms
9,524 KB |
testcase_21 | AC | 52 ms
9,404 KB |
testcase_22 | WA | - |
testcase_23 | AC | 52 ms
9,524 KB |
testcase_24 | AC | 52 ms
9,476 KB |
testcase_25 | AC | 52 ms
9,524 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 52 ms
9,528 KB |
testcase_29 | WA | - |
testcase_30 | AC | 52 ms
9,524 KB |
testcase_31 | AC | 52 ms
9,524 KB |
testcase_32 | AC | 52 ms
9,528 KB |
testcase_33 | WA | - |
testcase_34 | AC | 52 ms
9,524 KB |
ソースコード
# 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, d[1000000] = {}; bitset<10000>bi[10] = {}; struct edge { LL to, cost; }; vector<edge>vec[100000]; string st[2],str; int main() { cin >> str; bool fb[2] = {}, FF = 1; for (int i = 0; i < str.size(); i++) { sum += str[i] - '0'; } if (sum % 3 == 0)fb[0] = 1; LL i = 0; sum = 0; while (1) { if (i < str.size()) { int num = (str[i] - '0'); sum = (sum + (FF == 1 ? num % 10 : num * 4)) % 5; FF = !FF; i++; } 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; }