結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
kou_kkk
|
| 提出日時 | 2025-02-13 10:47:03 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 413 bytes |
| コンパイル時間 | 5,972 ms |
| コンパイル使用メモリ | 70,708 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-02-13 10:47:10 |
| 合計ジャッジ時間 | 5,987 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 35) Warning: imported and not used: 'strutils' [UnusedImport]
ソースコード
import algorithm, sets, sequtils, strutils
let
s = stdin.readLine
x = s.toSeq
y = x.reversed
var
list = newSeq[(string, int, int)]().repeat s.len.succ
list[0].add @[("", 0, 0)]
for i in 0 .. s.high:
for (str, cntX, cntY) in list[i]:
list[i.succ].add (str & x[cntX], cntX.succ, cntY)
list[i.succ].add (str & y[cntY], cntX, cntY.succ)
let
ans = list[^1].mapIt(it[0]).toHashSet.len
echo ans
kou_kkk