結果
| 問題 | No.26 シャッフルゲーム | 
| コンテスト | |
| ユーザー |  fujita | 
| 提出日時 | 2023-04-28 15:25:45 | 
| 言語 | C# (.NET 8.0.404) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 72 ms / 5,000 ms | 
| コード長 | 1,083 bytes | 
| コンパイル時間 | 12,770 ms | 
| コンパイル使用メモリ | 165,344 KB | 
| 実行使用メモリ | 183,968 KB | 
| 最終ジャッジ日時 | 2024-11-17 15:19:13 | 
| 合計ジャッジ時間 | 13,552 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (125 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/
ソースコード
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 sss = "";
            
            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();
            for(int c = 0; c < strings.Length; c++)
            {
                sss += strings[c];
                
            }
            
            
                int ans = sss.IndexOf(str);
            
            Console.WriteLine(ans + 1);
        }
    }
}
            
            
            
        