結果
| 問題 | No.593 4進FizzBuzz |
| コンテスト | |
| ユーザー |
6soukiti29
|
| 提出日時 | 2017-11-10 23:14:55 |
| 言語 | Nim (2.2.6) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 391 bytes |
| 記録 | |
| コンパイル時間 | 2,218 ms |
| コンパイル使用メモリ | 67,288 KB |
| 実行使用メモリ | 9,600 KB |
| 最終ジャッジ日時 | 2026-03-19 20:58:35 |
| 合計ジャッジ時間 | 4,196 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 25 WA * 6 |
コンパイルメッセージ
/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]
ソースコード
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
6soukiti29