結果

問題 No.1806 Rotating Golem
ユーザー bluemeganebluemegane
提出日時 2022-01-15 11:14:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 841 ms
コンパイル使用メモリ 108,484 KB
実行使用メモリ 25,928 KB
最終ジャッジ日時 2024-05-01 07:30:37
合計ジャッジ時間 2,000 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
23,984 KB
testcase_01 AC 27 ms
24,028 KB
testcase_02 AC 26 ms
23,644 KB
testcase_03 AC 26 ms
24,028 KB
testcase_04 AC 25 ms
21,680 KB
testcase_05 AC 26 ms
23,904 KB
testcase_06 AC 25 ms
23,512 KB
testcase_07 AC 26 ms
24,028 KB
testcase_08 AC 27 ms
23,984 KB
testcase_09 AC 26 ms
23,732 KB
testcase_10 AC 25 ms
22,196 KB
testcase_11 AC 26 ms
25,928 KB
testcase_12 AC 26 ms
23,504 KB
testcase_13 AC 25 ms
21,684 KB
testcase_14 AC 25 ms
23,492 KB
testcase_15 AC 26 ms
23,516 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

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