結果

問題 No.113 宝探し
ユーザー AreTrash
提出日時 2016-05-14 11:44:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 22 ms / 5,000 ms
コード長 506 bytes
コンパイル時間 1,972 ms
コンパイル使用メモリ 104,576 KB
実行使用メモリ 18,560 KB
最終ジャッジ日時 2024-11-16 21:13:56
合計ジャッジ時間 2,196 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace No113_1{
    public class Program{
        public static void Main(string[] args){
            var v = 0;
            var h = 0;
            foreach(var c in Console.ReadLine()){
                switch(c){
                    case 'N': v++; break;
                    case 'E': h--; break;
                    case 'W': h++; break;
                    case 'S': v--; break;
                } 
            }
            Console.WriteLine(Math.Sqrt(v * v + h * h));
        }
    }
}
0