結果

問題 No.113 宝探し
ユーザー しらゆきしらゆき
提出日時 2015-11-19 16:29:42
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 469 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 113,688 KB
実行使用メモリ 28,648 KB
最終ジャッジ日時 2024-04-28 07:30:34
合計ジャッジ時間 2,328 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
24,544 KB
testcase_01 AC 21 ms
26,512 KB
testcase_02 AC 21 ms
24,564 KB
testcase_03 AC 22 ms
26,520 KB
testcase_04 AC 21 ms
24,532 KB
testcase_05 AC 22 ms
22,580 KB
testcase_06 AC 21 ms
26,512 KB
testcase_07 AC 22 ms
22,584 KB
testcase_08 AC 22 ms
24,416 KB
testcase_09 AC 21 ms
24,552 KB
testcase_10 AC 23 ms
28,648 KB
testcase_11 AC 23 ms
26,628 KB
testcase_12 AC 23 ms
26,584 KB
testcase_13 AC 23 ms
26,628 KB
testcase_14 AC 22 ms
24,548 KB
testcase_15 AC 22 ms
26,640 KB
testcase_16 AC 22 ms
26,632 KB
testcase_17 AC 22 ms
22,576 KB
testcase_18 AC 23 ms
26,776 KB
testcase_19 AC 23 ms
26,392 KB
testcase_20 AC 23 ms
26,644 KB
testcase_21 AC 23 ms
26,584 KB
testcase_22 AC 24 ms
26,512 KB
testcase_23 AC 21 ms
23,776 KB
testcase_24 AC 22 ms
26,588 KB
testcase_25 AC 24 ms
24,876 KB
testcase_26 AC 22 ms
24,548 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    static void Main()
    {
        string s = Console.ReadLine();

        int x = 0;
        int y = 0;

        for (int i = 0; i < s.Length; i++)
        {
            switch (s[i])
            {
                case 'N': y++; break;
                case 'E': x++; break;
                case 'W': x--; break;
                case 'S': y--; break;
            }
        }

        Console.WriteLine(Math.Sqrt(x * x + y * y));
    }
}
0