結果

問題 No.123 カードシャッフル
ユーザー kmtrc130kmtrc130
提出日時 2017-05-16 16:45:53
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 110 ms / 5,000 ms
コード長 588 bytes
コンパイル時間 5,039 ms
コンパイル使用メモリ 103,880 KB
実行使用メモリ 28,880 KB
最終ジャッジ日時 2023-10-14 22:40:51
合計ジャッジ時間 5,479 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,940 KB
testcase_01 AC 63 ms
23,832 KB
testcase_02 AC 64 ms
23,884 KB
testcase_03 AC 63 ms
21,820 KB
testcase_04 AC 64 ms
23,780 KB
testcase_05 AC 63 ms
23,820 KB
testcase_06 AC 63 ms
19,820 KB
testcase_07 AC 63 ms
21,960 KB
testcase_08 AC 62 ms
21,924 KB
testcase_09 AC 63 ms
23,836 KB
testcase_10 AC 99 ms
24,360 KB
testcase_11 AC 102 ms
26,948 KB
testcase_12 AC 110 ms
28,880 KB
testcase_13 AC 108 ms
27,000 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        int[] NM = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        int[] A = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

        List<int> cards = new List<int>();
        for (int i = 0; i < NM[0]; i++) { cards.Add(i + 1); }

        for (int i = 0; i < NM[1]; i++)
        {
            cards.Insert(0, cards[A[i]-1]);
            cards.RemoveAt(A[i]);
        }

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