結果

問題 No.26 シャッフルゲーム
ユーザー phsplsphspls
提出日時 2020-03-24 23:18:58
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 5,000 ms
コード長 495 bytes
コンパイル時間 2,026 ms
コンパイル使用メモリ 104,532 KB
実行使用メモリ 23,740 KB
最終ジャッジ日時 2023-08-30 09:02:50
合計ジャッジ時間 3,413 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,632 KB
testcase_01 AC 61 ms
21,620 KB
testcase_02 AC 61 ms
21,708 KB
testcase_03 AC 61 ms
21,708 KB
testcase_04 AC 61 ms
21,704 KB
testcase_05 AC 60 ms
21,720 KB
testcase_06 AC 61 ms
23,656 KB
testcase_07 AC 60 ms
21,680 KB
testcase_08 AC 61 ms
21,644 KB
testcase_09 AC 62 ms
23,740 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;

public class P0026 {
    public static void Main() {
        var n = int.Parse(Console.ReadLine().Trim());
        var m = int.Parse(Console.ReadLine().Trim());
        for(int i=0; i<m; i++) {
            var pq = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList();
            if(pq[0] == n) {
                n = pq[1];
            } else if (pq[1] == n) {
                n = pq[0];
            }
        }
        Console.WriteLine(n);
    }
}
0