結果

問題 No.1020 Reverse
ユーザー joybeeeejoybeeee
提出日時 2020-05-13 22:19:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 3,395 ms
コンパイル使用メモリ 72,284 KB
実行使用メモリ 58,876 KB
最終ジャッジ日時 2023-10-12 17:07:23
合計ジャッジ時間 7,560 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,676 KB
testcase_01 AC 129 ms
56,060 KB
testcase_02 AC 129 ms
55,676 KB
testcase_03 WA -
testcase_04 AC 130 ms
55,672 KB
testcase_05 AC 133 ms
55,652 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 214 ms
58,420 KB
testcase_09 AC 212 ms
58,280 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 219 ms
58,588 KB
testcase_13 AC 220 ms
58,136 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 218 ms
58,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      String s = sc.next();
      int len = n - k + 1;
      String str1 = s.substring(0, k-1);
      String str2 = s.substring(k-1, n);
      System.out.println(str2 + str1);
  }
}
0