結果

問題 No.1020 Reverse
ユーザー ouoz1Vouoz1V
提出日時 2020-04-10 21:41:20
言語 Nim
(2.0.2)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 3,545 ms
コンパイル使用メモリ 69,052 KB
実行使用メモリ 4,716 KB
最終ジャッジ日時 2023-10-13 23:50:56
合計ジャッジ時間 4,622 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 5 ms
4,352 KB
testcase_08 AC 4 ms
4,352 KB
testcase_09 AC 3 ms
4,352 KB
testcase_10 AC 7 ms
4,348 KB
testcase_11 AC 8 ms
4,352 KB
testcase_12 AC 4 ms
4,372 KB
testcase_13 AC 4 ms
4,528 KB
testcase_14 AC 8 ms
4,464 KB
testcase_15 AC 11 ms
4,672 KB
testcase_16 AC 11 ms
4,716 KB
testcase_17 AC 4 ms
4,360 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 45) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated]
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 75) Warning: imported and not used: 'intsets' [UnusedImport]
/home/judge/data/code/Main.nim(1, 67) Warning: imported and not used: 'hashes' [UnusedImport]
/home/judge/data/code/Main.nim(1, 39) Warning: imported and not used: 'math' [UnusedImport]
/home/judge/data/code/Main.nim(1, 45) Warning: imported and not used: 'future' [UnusedImport]
/home/judge/data/code/Main.nim(1, 53) Warning: imported and not used: 'sets' [UnusedImport]
/home/judge/data/code/Main.nim(1, 59) Warning: imported and not used: 'tables' [UnusedImport]

ソースコード

diff #

import sequtils, strutils, algorithm, math, future, sets, tables, hashes, intsets
let read = iterator : string {.closure.} = (while true: (for s in stdin.readLine.split : yield s))

var
    n,k = read().parseint
    s = read()
    tail = ""

if (n - k + 1) mod 2 == 1:
    tail = s[0 ..< k - 1].reversed.join
else:
    tail = s[0 ..< k - 1]



echo s[k - 1 ..< n] & tail
0