結果

問題 No.1806 Rotating Golem
ユーザー ccc
提出日時 2022-07-27 16:23:50
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 682 bytes
コンパイル時間 10,028 ms
コンパイル使用メモリ 172,308 KB
実行使用メモリ 182,220 KB
最終ジャッジ日時 2024-07-17 05:21:14
合計ジャッジ時間 9,206 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 6 WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (95 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, int>()
        {
            {"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[pStart] - news[pEnd] + 4) % 4;
            Console.WriteLine(ans);
        }
    }
}
0