結果
| 問題 |
No.26 シャッフルゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-05 10:25:45 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 5,000 ms |
| コード長 | 716 bytes |
| コンパイル時間 | 7,890 ms |
| コンパイル使用メモリ | 171,408 KB |
| 実行使用メモリ | 188,760 KB |
| 最終ジャッジ日時 | 2025-11-05 10:25:54 |
| 合計ジャッジ時間 | 8,853 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge7 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (144 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
class Program
{
static void Main(string[] args)
{
string inputPosition = Console.ReadLine()!;
string inputCount = Console.ReadLine()!;
int firstPosition = int.Parse(inputPosition);
int moveCount = int.Parse(inputCount);
string record = inputPosition;
for (int i = 0; i < moveCount; i++)
{
string[] affterPosition = Console.ReadLine()!.Split(' ');
if (record == affterPosition[0])
{
record = affterPosition[1];
}
else if (record == affterPosition[1])
{
record = affterPosition[0];
}
}
Console.WriteLine(record);
}
}