結果
| 問題 |
No.1020 Reverse
|
| ユーザー |
nadeshino
|
| 提出日時 | 2020-04-10 21:44:00 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 431 bytes |
| コンパイル時間 | 3,565 ms |
| コンパイル使用メモリ | 65,408 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-15 19:47:15 |
| 合計ジャッジ時間 | 4,242 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 6 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 45) Warning: imported and not used: 'macros' [UnusedImport] /home/judge/data/code/Main.nim(1, 19) Warning: imported and not used: 'math' [UnusedImport] /home/judge/data/code/Main.nim(1, 25) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import algorithm, math, sequtils, strutils, macros
let read* = iterator: string {.closure.} =
while true: (for s in stdin.readLine.split: yield s)
template input*(T: static[typedesc]): untyped =
when T is int: read().parseInt
elif T is float: read().parseFloat
elif T is string: read()
let N, K = input(int)
let S = "#" & input(string)
if K < N:
echo S[K .. N] & S[1 .. K - 1]
else:
echo S[1 .. N].reversed.join("")
nadeshino