結果
| 問題 |
No.26 シャッフルゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-24 18:03:16 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 5,000 ms |
| コード長 | 944 bytes |
| コンパイル時間 | 974 ms |
| コンパイル使用メモリ | 104,448 KB |
| 実行使用メモリ | 19,200 KB |
| 最終ジャッジ日時 | 2024-06-26 04:55:56 |
| 合計ジャッジ時間 | 1,864 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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());
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);
}
}
}