結果
| 問題 | No.26 シャッフルゲーム | 
| コンテスト | |
| ユーザー |  _matumo_ | 
| 提出日時 | 2018-07-27 23:37:37 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 23 ms / 5,000 ms | 
| コード長 | 855 bytes | 
| コンパイル時間 | 959 ms | 
| コンパイル使用メモリ | 104,448 KB | 
| 実行使用メモリ | 19,200 KB | 
| 最終ジャッジ日時 | 2024-07-05 05:35:29 | 
| 合計ジャッジ時間 | 1,386 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace YukiCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] pn = new int[3];
            int M = int.Parse(Console.ReadLine());
            int N = int.Parse(Console.ReadLine());
            pn[M - 1] = 1;
            for (int i = 0; i < N; i++)
            {
                var va = Console.ReadLine().Split().Select(int.Parse).ToList();
                int n0 = va[0] - 1;
                int n1 = va[1] - 1;
                int cc = pn[n0]; pn[n0] = pn[n1]; pn[n1] = cc;
            }
            if (     pn[0] > 0)     Console.WriteLine(1);
            else if (pn[1] > 0)     Console.WriteLine(2);
            else                    Console.WriteLine(3);
            Console.ReadLine();
        }
    }
}
            
            
            
        