結果

問題 No.292 芸名
ユーザー chiyodachiyoda
提出日時 2016-06-21 01:09:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 537 bytes
コンパイル時間 2,153 ms
コンパイル使用メモリ 76,652 KB
実行使用メモリ 42,660 KB
最終ジャッジ日時 2024-04-19 23:31:46
合計ジャッジ時間 4,619 ms
ジャッジサーバーID
(参考情報)
judge4 / judge6
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
42,660 KB
testcase_01 AC 136 ms
42,304 KB
testcase_02 AC 147 ms
42,072 KB
testcase_03 AC 138 ms
42,324 KB
testcase_04 AC 155 ms
42,464 KB
testcase_05 AC 138 ms
42,612 KB
testcase_06 AC 143 ms
42,496 KB
testcase_07 AC 131 ms
42,212 KB
testcase_08 AC 144 ms
42,264 KB
testcase_09 AC 150 ms
42,320 KB
testcase_10 AC 153 ms
42,472 KB
testcase_11 AC 150 ms
42,128 KB
testcase_12 AC 145 ms
42,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int t = sc.nextInt();
    int u = sc.nextInt();
    String res = "";
    if (t == u) {
      res +=  S.substring(0, t) + S.substring(t + 1);
    } else if (t < u){
      res +=  S.substring(0, t) + S.substring(t + 1, u) + S.substring(u + 1); 
    } else {
      res +=  S.substring(0, u) + S.substring(u + 1, t) + S.substring(t + 1);
    }
    System.out.println(res);
  }  
}
0