結果

問題 No.26 シャッフルゲーム
ユーザー fujitafujita
提出日時 2023-04-28 13:50:12
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 899 bytes
コンパイル時間 17,416 ms
コンパイル使用メモリ 165,572 KB
実行使用メモリ 185,548 KB
最終ジャッジ日時 2024-04-28 19:14:48
合計ジャッジ時間 14,213 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
31,360 KB
testcase_01 AC 68 ms
31,484 KB
testcase_02 AC 67 ms
31,136 KB
testcase_03 AC 67 ms
31,220 KB
testcase_04 WA -
testcase_05 AC 70 ms
31,244 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 67 ms
185,548 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (131 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.Collections.Generic;
using System;
using System.Linq;
using System.Drawing;

namespace yukicoder
{
    class Program
    {

        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var M = int.Parse(Console.ReadLine());
            int M1, M2;
            
            
            string[] strings = new string[] {"1" , "2" , "3"};

            for (int i = 0; i < M; i++)
            {
                var O = Console.ReadLine().Split(" ");
                M1 = int.Parse(O[0]);
                M2 = int.Parse(O[1]);
                
                var temp = strings[M1 - 1];
                strings[M1 - 1] = strings[M2 - 1];
                strings[M2 - 1] = temp;
            }
            string str = N.ToString();

            int ans = str.IndexOf(str);
  
            Console.WriteLine(strings[ans]);
        }
    }
}
0