結果
| 問題 | 
                            No.113 宝探し
                             | 
                    
| コンテスト | |
| ユーザー | 
                             bluemegane
                         | 
                    
| 提出日時 | 2018-10-10 22:12:49 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 27 ms / 5,000 ms | 
| コード長 | 480 bytes | 
| コンパイル時間 | 834 ms | 
| コンパイル使用メモリ | 107,248 KB | 
| 実行使用メモリ | 18,560 KB | 
| 最終ジャッジ日時 | 2024-11-16 21:58:48 | 
| 合計ジャッジ時間 | 2,264 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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.
ソースコード
using static System.Math;
using System;
public class Hello
{
    public static void Main()
    {
        var d = new string[] { "N", "E", "S", "W" };
        var s = Console.ReadLine().Trim();
        var sL = s.Length;
        var a = new int[4];
        for (int i = 0; i < 4; i++)
            a[i] = sL - s.Replace(d[i], "").Length;
        var ns = a[0] - a[2];
        var ew = a[1] - a[3];
        var ans = Sqrt(ns * ns + ew * ew);
        Console.WriteLine(ans);
    }
}
            
            
            
        
            
bluemegane