結果

問題 No.113 宝探し
ユーザー i524
提出日時 2020-08-12 15:36:45
言語 TypeScript
(5.7.2)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 286 bytes
コンパイル時間 8,306 ms
コンパイル使用メモリ 228,836 KB
実行使用メモリ 39,552 KB
最終ジャッジ日時 2024-12-31 16:17:47
合計ジャッジ時間 11,482 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

const input = require("fs").readFileSync("/dev/stdin", "utf8");
const chars = input.split('');

const o = {
  N: 0,
  S: 0,
  E: 0,
  W: 0,
};

chars.forEach(c => {
  if (o.hasOwnProperty(c)) {
    o[c]++;
  }
})
console.log(Math.sqrt(Math.pow(o.N - o.S, 2) + Math.pow(o.E - o.W, 2)));
0