結果
| 問題 | No.400 鏡 |
| コンテスト | |
| ユーザー |
megane_anko
|
| 提出日時 | 2021-03-01 23:58:26 |
| 言語 | TypeScript(Node) (7.0.2 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 36 ms / 2,000 ms |
| + 945µs | |
| コード長 | 662 bytes |
| 記録 | |
| コンパイル時間 | 933 ms |
| コンパイル使用メモリ | 195,168 KB |
| 実行使用メモリ | 51,256 KB |
| 最終ジャッジ日時 | 2026-10-10 00:03:26 |
| 合計ジャッジ時間 | 2,518 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 8 |
ソースコード
import * as fs from 'fs';
const input = fs.readFileSync('/dev/stdin', 'utf8');
const nlarray = input.split('\n');
//1文字ずつ分割して格納
const array = nlarray[0].split('');
//文字列を反転させる(インデックスを反転させる)
let coordinate_array = [];
for (let i = array.length - 1; i >= 0; i--) {
coordinate_array.push(array[i]);
}
//<を>に、>を<に置換する処理
for (let j = 0; j < coordinate_array.length; j++) {
if (coordinate_array[j] === '<') {
coordinate_array[j] = '>';
} else if (coordinate_array[j] === '>') {
coordinate_array[j] = '<';
}
}
console.log(coordinate_array.join(''));
megane_anko