結果

問題 No.593 4進FizzBuzz
ユーザー GrayCoderGrayCoder
提出日時 2017-11-12 15:01:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 11,992 KB
最終ジャッジ日時 2023-08-16 10:56:31
合計ジャッジ時間 15,539 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,800 KB
testcase_01 AC 15 ms
7,752 KB
testcase_02 AC 15 ms
7,872 KB
testcase_03 AC 15 ms
7,796 KB
testcase_04 AC 15 ms
7,920 KB
testcase_05 AC 15 ms
7,928 KB
testcase_06 AC 15 ms
7,832 KB
testcase_07 AC 15 ms
7,832 KB
testcase_08 AC 15 ms
7,820 KB
testcase_09 AC 15 ms
7,820 KB
testcase_10 AC 15 ms
7,876 KB
testcase_11 AC 15 ms
7,776 KB
testcase_12 AC 15 ms
7,796 KB
testcase_13 AC 15 ms
7,880 KB
testcase_14 AC 15 ms
7,876 KB
testcase_15 AC 15 ms
7,780 KB
testcase_16 AC 619 ms
11,812 KB
testcase_17 WA -
testcase_18 AC 617 ms
11,848 KB
testcase_19 AC 618 ms
11,816 KB
testcase_20 WA -
testcase_21 AC 616 ms
11,864 KB
testcase_22 AC 626 ms
11,868 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 619 ms
11,856 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 623 ms
11,840 KB
testcase_30 AC 614 ms
11,864 KB
testcase_31 AC 612 ms
11,860 KB
testcase_32 AC 621 ms
11,868 KB
testcase_33 AC 585 ms
11,816 KB
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = input()

    three = 3
    five = 11
    even = 0
    odd = 0
    i = len(N) - 1
    while i > 0:
        odd += int(N[i])
        even += int(N[i-1])
        i -= 2
    if not i:
        odd += int(N[0])

    ans = ''
    if not (odd + even) % three:
        ans += 'Fizz'
    if not (odd - even) % five:
        ans += 'Buzz'
    if ans == '':
        print(N)
    else:
        print(ans)

main()
0