結果

問題 No.1806 Rotating Golem
ユーザー bluemeganebluemegane
提出日時 2022-01-15 11:14:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 2,235 ms
コンパイル使用メモリ 66,848 KB
実行使用メモリ 22,548 KB
最終ジャッジ日時 2023-08-13 14:33:13
合計ジャッジ時間 4,092 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
22,532 KB
testcase_01 AC 55 ms
20,468 KB
testcase_02 AC 56 ms
22,548 KB
testcase_03 AC 55 ms
20,504 KB
testcase_04 AC 55 ms
20,448 KB
testcase_05 AC 54 ms
20,388 KB
testcase_06 AC 54 ms
20,440 KB
testcase_07 AC 55 ms
20,344 KB
testcase_08 AC 55 ms
22,452 KB
testcase_09 AC 55 ms
18,512 KB
testcase_10 AC 55 ms
22,508 KB
testcase_11 AC 55 ms
22,452 KB
testcase_12 AC 55 ms
22,504 KB
testcase_13 AC 56 ms
20,580 KB
testcase_14 AC 55 ms
20,580 KB
testcase_15 AC 55 ms
22,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System.Collections.Generic;
using System;

public class Hello
{
    static void Main()
    {
        var a = Console.ReadLine().Trim();
        var b = Console.ReadLine().Trim();
        getAns(a, b);
    }
    static void getAns(string a, string b)
    {
        var d = new Dictionary<string, int>();
        d["N"] = 0;
        d["E"] = 1;
        d["S"] = 2;
        d["W"] = 3;
        var ans = d[b] - d[a];
        Console.WriteLine(ans >= 0 ? ans : ans + 4);
    }
}
0