結果

問題 No.123 カードシャッフル
ユーザー mbanmban
提出日時 2016-11-07 10:48:25
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 586 bytes
コンパイル時間 2,151 ms
コンパイル使用メモリ 104,720 KB
実行使用メモリ 29,840 KB
最終ジャッジ日時 2023-08-16 14:16:17
合計ジャッジ時間 4,007 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,628 KB
testcase_01 AC 60 ms
21,692 KB
testcase_02 AC 59 ms
21,632 KB
testcase_03 WA -
testcase_04 AC 61 ms
23,552 KB
testcase_05 WA -
testcase_06 AC 60 ms
23,644 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 60 ms
21,720 KB
testcase_10 AC 90 ms
29,336 KB
testcase_11 AC 90 ms
25,820 KB
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 Magatro
{
    static void Main()
    {
        int N, M;
        string[] s = Console.ReadLine().Split(' ');
        N = int.Parse(s[0]);
        M = int.Parse(s[1]);
        int[] A = Console.ReadLine().Split(' ').Select(ss => int.Parse(ss)).ToArray();
        List<int> L = new List<int>();
        for(int i = N; i >= 1; i--)
        {
            L.Add(i);
        }
        for(int i = 0; i < M; i++)
        {
            L.Add(L[L.Count - A[i]]);
        }
        Console.WriteLine(L[L.Count-1]);
    }
}
0