結果
問題 | No.729 文字swap |
ユーザー | fabled2468 |
提出日時 | 2018-09-23 19:46:40 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 695 bytes |
コンパイル時間 | 2,259 ms |
コンパイル使用メモリ | 73,884 KB |
実行使用メモリ | 49,348 KB |
最終ジャッジ日時 | 2023-10-12 14:28:34 |
合計ジャッジ時間 | 3,696 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 41 ms
48,848 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
ソースコード
import java.util.Arrays; import java.util.List; import java.util.StringJoiner; class Main_729_swapString { public static void main(String[] args) { String value0 = "samples"; int value1 = 0; int value2 = 6; String result = String.join("", swapString(value0, value1, value2)); System.out.println(result); } static String[] swapString(String value0, int value1, int value2) { String[] textList = value0.split(""); String targetString1 = textList[value1]; String targetString2 = textList[value2]; textList[value2] = targetString1; textList[value1] = targetString2; return textList; } }