結果

問題 No.292 芸名
コンテスト
ユーザー mkanenobu
提出日時 2018-03-21 15:40:14
言語 Nim
(2.2.6)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 302 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,540 ms
コンパイル使用メモリ 68,768 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-19 23:14:43
合計ジャッジ時間 3,139 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(14, 7) Warning: use `delete(s, first..last)`; delete is deprecated [Deprecated]
/home/judge/data/code/Main.nim(17, 7) Warning: use `delete(s, first..last)`; delete is deprecated [Deprecated]
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #
raw source code

import sequtils, strutils

var
    input = readLine(stdin).split
    s: string
    t, u: int

s = input[0]
t = input[1].parseInt
u = input[2].parseInt


proc main():string =
    s.delete(max(t, u), max(t, u))
    if t == u:
        return s
    s.delete(min(t, u), min(t, u))
    return s

echo main()
0