結果
問題 |
No.113 宝探し
|
ユーザー |
![]() |
提出日時 | 2018-03-02 14:39:58 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 87 ms / 5,000 ms |
コード長 | 333 bytes |
コンパイル時間 | 67 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,544 KB |
最終ジャッジ日時 | 2024-11-16 21:47:51 |
合計ジャッジ時間 | 3,010 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 |
コンパイルメッセージ
Syntax OK
ソースコード
coord = gets.chomp.split(//).map.inject([0, 0]){ |now, val| case val when 'N' now[1] += 1 when 'E' now[0] += 1 when 'W' now[0] -= 1 when 'S' now[1] -= 1 end now } puts (coord[0] ** 2 + coord[1] ** 2) ** 0.5