結果

問題 No.729 文字swap
ユーザー GrenacheGrenache
提出日時 2018-09-16 16:54:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 736 bytes
コンパイル時間 3,369 ms
コンパイル使用メモリ 72,572 KB
実行使用メモリ 56,372 KB
最終ジャッジ日時 2023-09-25 09:01:19
合計ジャッジ時間 6,123 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,676 KB
testcase_01 AC 124 ms
56,372 KB
testcase_02 AC 125 ms
55,628 KB
testcase_03 AC 125 ms
55,856 KB
testcase_04 AC 128 ms
55,384 KB
testcase_05 AC 126 ms
55,472 KB
testcase_06 AC 125 ms
55,796 KB
testcase_07 AC 124 ms
55,384 KB
testcase_08 AC 125 ms
55,648 KB
testcase_09 AC 124 ms
55,668 KB
testcase_10 AC 124 ms
55,648 KB
testcase_11 AC 125 ms
55,380 KB
testcase_12 AC 124 ms
55,736 KB
testcase_13 AC 125 ms
55,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder729 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s = sc.next().toCharArray();
		int i = sc.nextInt();
		int j = sc.nextInt();

		char tmp = s[i]; s[i] = s[j]; s[j] = tmp;

		pr.println(s);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0