結果

問題 No.1020 Reverse
ユーザー keymoonkeymoon
提出日時 2021-01-15 19:52:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 689 bytes
コンパイル時間 3,640 ms
コンパイル使用メモリ 104,024 KB
実行使用メモリ 30,788 KB
最終ジャッジ日時 2023-08-17 14:36:26
合計ジャッジ時間 4,146 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
21,864 KB
testcase_01 AC 59 ms
21,824 KB
testcase_02 AC 60 ms
21,684 KB
testcase_03 AC 63 ms
21,824 KB
testcase_04 AC 59 ms
23,812 KB
testcase_05 AC 59 ms
21,832 KB
testcase_06 AC 63 ms
21,880 KB
testcase_07 AC 66 ms
22,500 KB
testcase_08 AC 62 ms
24,584 KB
testcase_09 AC 60 ms
22,220 KB
testcase_10 AC 67 ms
21,272 KB
testcase_11 AC 72 ms
23,732 KB
testcase_12 AC 62 ms
22,848 KB
testcase_13 AC 63 ms
22,856 KB
testcase_14 AC 73 ms
25,844 KB
testcase_15 AC 77 ms
30,788 KB
testcase_16 AC 77 ms
28,876 KB
testcase_17 AC 62 ms
22,716 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var nk = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var n = nk[0];
        var k = nk[1];
        var s = Console.ReadLine();
        var prev = s.Substring(k - 1);
        var after = s.Substring(0, k - 1);
        if ((k - n) % 2 == 0) after = string.Join("", after.Reverse());
        Console.WriteLine(prev + after);
    }
}
0