結果

問題 No.113 宝探し
ユーザー fshutofshuto
提出日時 2019-04-30 15:59:07
言語 Ruby
(3.3.0)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 197 bytes
コンパイル時間 634 ms
コンパイル使用メモリ 11,388 KB
実行使用メモリ 15,620 KB
最終ジャッジ日時 2023-08-10 15:24:09
合計ジャッジ時間 3,562 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,532 KB
testcase_01 AC 77 ms
15,532 KB
testcase_02 AC 77 ms
15,488 KB
testcase_03 AC 78 ms
15,332 KB
testcase_04 AC 83 ms
15,416 KB
testcase_05 AC 78 ms
15,396 KB
testcase_06 AC 77 ms
15,620 KB
testcase_07 AC 77 ms
15,596 KB
testcase_08 AC 78 ms
15,468 KB
testcase_09 AC 77 ms
15,420 KB
testcase_10 AC 77 ms
15,404 KB
testcase_11 AC 77 ms
15,372 KB
testcase_12 AC 76 ms
15,572 KB
testcase_13 AC 77 ms
15,116 KB
testcase_14 AC 77 ms
15,156 KB
testcase_15 AC 78 ms
15,528 KB
testcase_16 AC 78 ms
15,592 KB
testcase_17 AC 76 ms
14,988 KB
testcase_18 AC 79 ms
15,224 KB
testcase_19 AC 81 ms
15,496 KB
testcase_20 AC 81 ms
15,324 KB
testcase_21 AC 81 ms
15,392 KB
testcase_22 AC 81 ms
15,484 KB
testcase_23 AC 82 ms
14,988 KB
testcase_24 AC 82 ms
15,548 KB
testcase_25 AC 82 ms
15,488 KB
testcase_26 AC 81 ms
15,316 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

tate = 0
yoko = 0
gets.chomp.chars.each do |d|
  if d == 'N'
    tate += 1
  elsif d == 'E'
    yoko += 1
  elsif d == 'W'
    yoko -=1
  else
    tate -=1
  end
end
puts (tate**2 + yoko**2) ** 0.5
0