結果

問題 No.26 シャッフルゲーム
ユーザー _matumo__matumo_
提出日時 2018-07-27 23:37:37
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 5,000 ms
コード長 855 bytes
コンパイル時間 3,088 ms
コンパイル使用メモリ 100,424 KB
実行使用メモリ 23,768 KB
最終ジャッジ日時 2023-09-18 14:50:37
合計ジャッジ時間 4,736 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
23,768 KB
testcase_01 AC 60 ms
21,572 KB
testcase_02 AC 61 ms
23,612 KB
testcase_03 AC 61 ms
23,724 KB
testcase_04 AC 61 ms
23,644 KB
testcase_05 AC 60 ms
21,648 KB
testcase_06 AC 60 ms
21,564 KB
testcase_07 AC 61 ms
21,600 KB
testcase_08 AC 61 ms
23,628 KB
testcase_09 AC 60 ms
23,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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();
        }
    }
}
0