結果

問題 No.1806 Rotating Golem
ユーザー ccc
提出日時 2022-07-27 16:32:00
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 667 bytes
コンパイル時間 7,387 ms
コンパイル使用メモリ 166,636 KB
実行使用メモリ 181,464 KB
最終ジャッジ日時 2024-07-17 05:39:15
合計ジャッジ時間 8,946 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (93 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        // 要素を作成
        var news = new Dictionary<string, double>()
        {
            {"N", 0 },
            {"E", 1 },
            {"S", 2 },
            {"W", 3 },
        };

        // 標準入力取得
        var pStart = Console.ReadLine();
        var pEnd = Console.ReadLine();

        if (pStart == pEnd)
        {
            Console.WriteLine("0");
        }
        else
        {
            // 工程を算出
            var ans = (news[pEnd] - news[pStart] + 4) % 4;
            Console.WriteLine(ans);
        }
    }
}
0