結果

問題 No.1020 Reverse
ユーザー n_gojon_gojo
提出日時 2020-04-13 13:46:32
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 499 bytes
コンパイル時間 4,018 ms
コンパイル使用メモリ 74,292 KB
実行使用メモリ 64,228 KB
最終ジャッジ日時 2024-09-24 19:34:57
合計ジャッジ時間 8,706 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 TLE * 1 -- * 10
権限があれば一括ダウンロードができます

ソースコード

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