結果

問題 No.123 カードシャッフル
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-09-28 00:28:25
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 67 ms / 5,000 ms
コード長 624 bytes
コンパイル時間 844 ms
コンパイル使用メモリ 111,532 KB
実行使用メモリ 31,744 KB
最終ジャッジ日時 2024-04-20 09:16:12
合計ジャッジ時間 1,811 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
25,292 KB
testcase_01 AC 27 ms
27,044 KB
testcase_02 AC 27 ms
27,328 KB
testcase_03 AC 27 ms
27,176 KB
testcase_04 AC 27 ms
27,312 KB
testcase_05 AC 29 ms
25,168 KB
testcase_06 AC 27 ms
27,172 KB
testcase_07 AC 28 ms
25,160 KB
testcase_08 AC 28 ms
25,288 KB
testcase_09 AC 26 ms
25,384 KB
testcase_10 AC 51 ms
31,744 KB
testcase_11 AC 60 ms
30,580 KB
testcase_12 AC 67 ms
28,204 KB
testcase_13 AC 65 ms
28,316 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.Linq;
using System.Collections.Generic;

class No123
{
    static void Main()
    {
        var num = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();
        var count = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();
        var list = new List<int>();
        for (int i = num[0]; i > 0; --i)
        {
            list.Add(i);
        }
        for (int i = 0; i < num[1]; ++i)
        {
            var card = list[num[0] - count[i]];
            list.Remove(card);
            list.Add(card);
        }
        Console.WriteLine(list.Last());
    }
}
0