結果

問題 No.1806 Rotating Golem
ユーザー ccc
提出日時 2022-07-27 16:11:12
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 674 bytes
コンパイル時間 9,546 ms
コンパイル使用メモリ 171,092 KB
実行使用メモリ 182,960 KB
最終ジャッジ日時 2024-07-17 05:04:13
合計ジャッジ時間 11,304 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 4 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (96 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; // 宣言

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

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

        if ( pStart == pEnd)
        {
            Console.WriteLine("0");
        }
        else
        {
            // 絶対値として工程を算出
            var ans = Math.Abs(news[pStart] - news[pEnd]);
            Console.WriteLine(ans);
        }
    }
}
0