結果

問題 No.1806 Rotating Golem
ユーザー cccccc
提出日時 2022-07-27 16:16:47
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 689 bytes
コンパイル時間 8,185 ms
コンパイル使用メモリ 146,880 KB
実行使用メモリ 161,708 KB
最終ジャッジ日時 2023-09-24 04:56:11
合計ジャッジ時間 9,979 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 46 ms
26,280 KB
testcase_02 AC 49 ms
26,608 KB
testcase_03 AC 48 ms
26,616 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 46 ms
26,348 KB
testcase_07 AC 48 ms
26,688 KB
testcase_08 AC 48 ms
26,296 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 48 ms
26,632 KB
testcase_13 AC 47 ms
26,404 KB
testcase_14 AC 45 ms
26,384 KB
testcase_15 AC 45 ms
161,708 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  Determining projects to restore...
  Restored /home/judge/data/code/main.csproj (in 127 ms).
.NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f
Copyright (C) Microsoft Corporation.All rights reserved.

  プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください
  main -> /home/judge/data/code/bin/Release/net6.0/main.dll
  main -> /home/judge/data/code/bin/Release/net6.0/publish/

ソースコード

diff #

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

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

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

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