結果

問題 No.593 4進FizzBuzz
ユーザー 6soukiti296soukiti29
提出日時 2017-11-10 23:14:55
言語 Nim
(2.0.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 391 bytes
コンパイル時間 4,566 ms
コンパイル使用メモリ 67,736 KB
実行使用メモリ 11,032 KB
最終ジャッジ日時 2023-09-12 15:25:54
合計ジャッジ時間 6,392 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 33 ms
10,184 KB
testcase_17 WA -
testcase_18 AC 33 ms
10,156 KB
testcase_19 AC 33 ms
10,172 KB
testcase_20 WA -
testcase_21 AC 33 ms
10,288 KB
testcase_22 AC 33 ms
10,340 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 33 ms
10,336 KB
testcase_27 AC 34 ms
10,196 KB
testcase_28 WA -
testcase_29 AC 34 ms
10,204 KB
testcase_30 AC 23 ms
10,652 KB
testcase_31 AC 23 ms
10,284 KB
testcase_32 AC 22 ms
10,328 KB
testcase_33 AC 23 ms
10,164 KB
testcase_34 AC 21 ms
10,392 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/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 mod 2 == 0:
        cnt += c.ord - '0'.ord
    else:
        cnt -= c.ord - '0'.ord
if cnt == 0:
    ans &= "Buzz"

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