結果

問題 No.113 宝探し
ユーザー bluemeganebluemegane
提出日時 2018-10-10 22:12:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 480 bytes
コンパイル時間 817 ms
コンパイル使用メモリ 107,084 KB
実行使用メモリ 28,708 KB
最終ジャッジ日時 2024-04-28 08:16:55
合計ジャッジ時間 2,419 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
26,724 KB
testcase_01 AC 27 ms
24,428 KB
testcase_02 AC 27 ms
24,432 KB
testcase_03 AC 27 ms
24,752 KB
testcase_04 AC 28 ms
24,240 KB
testcase_05 AC 28 ms
24,496 KB
testcase_06 AC 28 ms
24,756 KB
testcase_07 AC 27 ms
24,500 KB
testcase_08 AC 27 ms
24,684 KB
testcase_09 AC 27 ms
26,596 KB
testcase_10 AC 28 ms
26,344 KB
testcase_11 AC 28 ms
24,628 KB
testcase_12 AC 28 ms
24,552 KB
testcase_13 AC 27 ms
24,500 KB
testcase_14 AC 27 ms
24,552 KB
testcase_15 AC 28 ms
24,552 KB
testcase_16 AC 28 ms
24,756 KB
testcase_17 AC 27 ms
24,492 KB
testcase_18 AC 28 ms
24,684 KB
testcase_19 AC 28 ms
24,808 KB
testcase_20 AC 28 ms
28,708 KB
testcase_21 AC 28 ms
26,412 KB
testcase_22 AC 28 ms
24,684 KB
testcase_23 AC 26 ms
21,684 KB
testcase_24 AC 28 ms
24,752 KB
testcase_25 AC 28 ms
24,556 KB
testcase_26 AC 29 ms
24,620 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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);
    }
}
0