結果
| 問題 | No.26 シャッフルゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-04-24 18:01:46 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 26 ms / 5,000 ms | 
| コード長 | 969 bytes | 
| コンパイル時間 | 899 ms | 
| コンパイル使用メモリ | 110,800 KB | 
| 実行使用メモリ | 19,456 KB | 
| 最終ジャッジ日時 | 2024-06-26 04:54:39 | 
| 合計ジャッジ時間 | 1,905 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;
namespace yukicoder
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int ans = 0;
            for (int i = 0; i < m; i++)
            {
                var s = Console.ReadLine().Split().Select(int.Parse).ToArray();
                var s1 = s[0];
                var s2 = s[1];
                if (n == s1)
                {
                    n = s2;
                }
                else if (n == s2)
                {
                    n = s1;
                }
            }
            Console.WriteLine(n);
        }
    }
}
            
            
            
        