結果
| 問題 |
No.26 シャッフルゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-25 13:18:28 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 5,000 ms |
| コード長 | 683 bytes |
| コンパイル時間 | 876 ms |
| コンパイル使用メモリ | 104,960 KB |
| 実行使用メモリ | 19,200 KB |
| 最終ジャッジ日時 | 2024-12-23 08:23:05 |
| 合計ジャッジ時間 | 1,761 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.Linq;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
int ans = int.Parse(Console.ReadLine());
long n = long.Parse(Console.ReadLine());
for (long i = 0; i < n; i++)
{
int[] change = Console.ReadLine().Split().Select(a => int.Parse(a)).ToArray();
if (ans == change[0])
{
ans = change[1];
continue;
}
if (ans == change[1])
{
ans = change[0];
continue;
}
}
Console.WriteLine(ans);
Console.Read();
}
}