結果

問題 No.1020 Reverse
ユーザー n_gojon_gojo
提出日時 2020-04-13 13:46:32
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 499 bytes
コンパイル時間 3,555 ms
コンパイル使用メモリ 75,132 KB
実行使用メモリ 57,676 KB
最終ジャッジ日時 2023-10-25 00:32:30
合計ジャッジ時間 8,387 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
57,672 KB
testcase_01 AC 130 ms
57,452 KB
testcase_02 AC 129 ms
57,420 KB
testcase_03 AC 156 ms
57,676 KB
testcase_04 AC 132 ms
55,400 KB
testcase_05 AC 163 ms
57,672 KB
testcase_06 AC 129 ms
57,348 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No1020 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String str = sc.next();
        char[] c = str.toCharArray();
        for(int i=0;i<=(n-k);i++) {
            char[] newC = c.clone();
            for(int j=0;j<k;j++){
                newC[i+j]=c[i+(k-j)-1];
            }
            c=newC;
        }
        System.out.println(c);
    }
}
0