結果
| 問題 | No.729 文字swap |
| コンテスト | |
| ユーザー |
chachamame0420
|
| 提出日時 | 2018-09-20 14:03:06 |
| 言語 | JavaScript (node v23.5.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 575 bytes |
| 記録 | |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 6,688 KB |
| 実行使用メモリ | 39,424 KB |
| 最終ジャッジ日時 | 2024-10-13 00:39:23 |
| 合計ジャッジ時間 | 1,594 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 2 WA * 9 |
ソースコード
function Main(input) {
// inputにはすべての入力の文字列が与えられるので必要に応じて input.split("\n") などで分割する。
const data = input.split("\n")
let targetString = data[0];
const firstIndex = +data[1].split(' ')[0]
const secondIndex = +data[1].split(' ')[1]
const temp = targetString[firstIndex]
targetString[firstIndex] = targetString[secondIndex]
targetString[secondIndex] = temp
console.log( targetString )
}
// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
chachamame0420