結果

問題 No.26 シャッフルゲーム
ユーザー mbanmban
提出日時 2016-11-04 17:07:13
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 646 bytes
コンパイル時間 2,100 ms
コンパイル使用メモリ 105,408 KB
実行使用メモリ 23,656 KB
最終ジャッジ日時 2023-08-16 13:46:43
合計ジャッジ時間 3,528 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
21,608 KB
testcase_01 AC 60 ms
21,676 KB
testcase_02 AC 59 ms
21,544 KB
testcase_03 AC 61 ms
23,600 KB
testcase_04 AC 60 ms
23,596 KB
testcase_05 AC 60 ms
21,608 KB
testcase_06 AC 59 ms
23,656 KB
testcase_07 AC 59 ms
21,700 KB
testcase_08 AC 60 ms
23,620 KB
testcase_09 AC 59 ms
21,600 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;
using System.Threading.Tasks;

class Magatro
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        int M = int.Parse(Console.ReadLine());
       for(int i=0;i< M; i++)
        {
            int[] s = Console.ReadLine().Split(' ').Select(p => int.Parse(p)).ToArray();
            if (s[0] == N)
            {
                N = s[1];
                continue;
            }
            if (s[1] == N)
            {
                N = s[0];
                continue;
            }
        }
        Console.WriteLine(N);
    }
}
0