結果
| 問題 |
No.123 カードシャッフル
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-04-10 16:35:01 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 89 ms / 5,000 ms |
| コード長 | 803 bytes |
| コンパイル時間 | 9,216 ms |
| コンパイル使用メモリ | 172,068 KB |
| 実行使用メモリ | 199,232 KB |
| 最終ジャッジ日時 | 2025-04-10 16:35:13 |
| 合計ジャッジ時間 | 10,494 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (119 ミリ秒)。 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)
{
int[] nm = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num));
List<int> card = new List<int>();
card = CardListCreation(nm[0],card);
int[] shuffle = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num));
for(int i = 0; i < nm[1]; i++)
{
card.Insert(0, card[shuffle[i]-1]);
card.RemoveAt(shuffle[i]);
}
Console.WriteLine(card[0]);
}
private static List<int> CardListCreation(int v,List<int> card)
{
for(int i = 1; i <= v; i++)
{
card.Add(i);
}
return card;
}
}
Maeda