結果
問題 | No.123 カードシャッフル |
ユーザー |
![]() |
提出日時 | 2018-09-28 00:28:25 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 67 ms / 5,000 ms |
コード長 | 624 bytes |
コンパイル時間 | 1,395 ms |
コンパイル使用メモリ | 106,240 KB |
実行使用メモリ | 25,136 KB |
最終ジャッジ日時 | 2024-10-12 04:41:10 |
合計ジャッジ時間 | 1,834 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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());}}