結果

問題 No.123 カードシャッフル
コンテスト
ユーザー Himatsubushin
提出日時 2022-12-23 09:02:21
言語 C#
(.NET 10.0.201)
コンパイル:
dotnet_c
実行:
/usr/bin/dotnet_wrap
結果
RE  
実行時間 -
コード長 672 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 15,216 ms
コンパイル使用メモリ 171,396 KB
実行使用メモリ 206,868 KB
最終ジャッジ日時 2026-05-12 18:50:06
合計ジャッジ時間 19,150 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 RE * 3
other RE * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (120 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

using System;

namespace No._39
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> card = new List<int>();

            int[] num = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int n = num[0];
            int k = num[1];
            int i;

            for (i = 0; i < n; i++)
                card.Insert(i, i + 1);

            for (; k > 0; k--)
            {
                i = int.Parse(Console.ReadLine());
                int temp = card[--i];
                card.Remove(card[i]);
                card.Insert(0, temp);
            }

            Console.WriteLine(card[0]);
        }
    }
}
0