結果

問題 No.26 シャッフルゲーム
ユーザー kmtrc130kmtrc130
提出日時 2017-04-25 10:50:46
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 624 bytes
コンパイル時間 2,211 ms
コンパイル使用メモリ 106,140 KB
実行使用メモリ 23,724 KB
最終ジャッジ日時 2023-10-11 09:15:28
合計ジャッジ時間 3,539 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,704 KB
testcase_01 AC 58 ms
21,676 KB
testcase_02 AC 59 ms
21,756 KB
testcase_03 AC 59 ms
21,560 KB
testcase_04 AC 63 ms
21,624 KB
testcase_05 AC 60 ms
21,764 KB
testcase_06 AC 60 ms
19,520 KB
testcase_07 AC 60 ms
23,612 KB
testcase_08 AC 60 ms
23,724 KB
testcase_09 AC 60 ms
21,668 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.Linq;

class Program
{
    static void Main(string[] args)
    {
        string[] cup = new string[3];

        int N = int.Parse(Console.ReadLine());
        cup[N - 1] = "○";

        int M = int.Parse(Console.ReadLine());
        string taihi = "";
        int[] PQ;
        for (int i = 0; i < M; i++)
        {
            PQ = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

            taihi = cup[PQ[0] - 1];
            cup[PQ[0] - 1] = cup[PQ[1] - 1];
            cup[PQ[1] - 1] = taihi;
        }

        Console.WriteLine(Array.IndexOf(cup, "○") + 1);
    }
}
0