結果

問題 No.123 カードシャッフル
ユーザー boya978boya978
提出日時 2020-05-01 00:33:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 681 bytes
コンパイル時間 3,693 ms
コンパイル使用メモリ 102,088 KB
実行使用メモリ 26,972 KB
最終ジャッジ日時 2023-08-22 22:09:25
合計ジャッジ時間 4,238 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
23,784 KB
testcase_01 AC 61 ms
23,904 KB
testcase_02 AC 62 ms
23,780 KB
testcase_03 AC 62 ms
21,872 KB
testcase_04 AC 62 ms
23,848 KB
testcase_05 AC 61 ms
21,784 KB
testcase_06 AC 63 ms
23,824 KB
testcase_07 AC 63 ms
21,848 KB
testcase_08 AC 61 ms
19,780 KB
testcase_09 AC 61 ms
23,788 KB
testcase_10 AC 92 ms
26,480 KB
testcase_11 AC 109 ms
26,972 KB
testcase_12 AC 117 ms
26,928 KB
testcase_13 AC 116 ms
26,792 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;
public class Hello{
    public static void Main(){

        var n = Console.ReadLine().Split().Select(int.Parse).ToArray();
        
        var cards = new List<int>();
        for(int i=n[0];i>0;i--)
            cards.Add(i);
        
        
        n = Console.ReadLine().Split().Select(int.Parse).ToArray();
        
        for(int i=0;i<n.Length;i++)
        {
            cards.Reverse();
                int tmp=cards[n[i]-1];
                cards.RemoveAt(n[i]-1);
            cards.Reverse();
                cards.Add(tmp);
        }
        
        Console.WriteLine(cards[cards.Count-1]);
    }
}
0