結果

問題 No.123 カードシャッフル
ユーザー mbanmban
提出日時 2016-11-07 10:48:25
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 586 bytes
コンパイル時間 930 ms
コンパイル使用メモリ 114,704 KB
実行使用メモリ 33,200 KB
最終ジャッジ日時 2024-05-03 22:36:24
合計ジャッジ時間 2,005 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
27,068 KB
testcase_01 AC 29 ms
25,016 KB
testcase_02 AC 29 ms
27,188 KB
testcase_03 WA -
testcase_04 AC 29 ms
25,008 KB
testcase_05 WA -
testcase_06 AC 29 ms
25,268 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 29 ms
24,888 KB
testcase_10 AC 56 ms
30,908 KB
testcase_11 AC 58 ms
31,440 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