結果

問題 No.593 4進FizzBuzz
ユーザー 6soukiti296soukiti29
提出日時 2017-11-14 16:26:32
言語 Nim
(2.0.0)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 2,847 ms
コンパイル使用メモリ 67,972 KB
実行使用メモリ 10,848 KB
最終ジャッジ日時 2023-09-12 15:27:47
合計ジャッジ時間 5,660 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 32 ms
10,212 KB
testcase_17 WA -
testcase_18 AC 33 ms
10,324 KB
testcase_19 AC 34 ms
10,320 KB
testcase_20 WA -
testcase_21 AC 32 ms
10,092 KB
testcase_22 AC 34 ms
10,160 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 34 ms
10,364 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 34 ms
10,192 KB
testcase_30 AC 23 ms
10,256 KB
testcase_31 AC 23 ms
10,160 KB
testcase_32 AC 22 ms
10,428 KB
testcase_33 AC 23 ms
10,332 KB
testcase_34 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 17) Warning: imported and not used: 'strutils' [UnusedImport]

ソースコード

diff #

import sequtils,strutils
var
    S = stdin.readline
    ans : string = ""
    cnt : int
    
for c in S:
    cnt += c.ord - '0'.ord
    while cnt >= 3:
        cnt -= 3
if cnt == 0:
    ans &= "Fizz"

cnt = 0
for i,c in S:
    if (i and 1) == 0:
        cnt += c.ord - '0'.ord
    else:
        cnt -= c.ord - '0'.ord
if cnt mod 11 == 0:
    ans &= "Buzz"

if ans == "":
    echo S
else:
    echo ans
0