結果
問題 | No.123 カードシャッフル |
ユーザー |
|
提出日時 | 2020-08-03 04:18:47 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 83 ms / 5,000 ms |
コード長 | 625 bytes |
コンパイル時間 | 895 ms |
コンパイル使用メモリ | 115,616 KB |
実行使用メモリ | 32,108 KB |
最終ジャッジ日時 | 2024-07-21 20:38:00 |
合計ジャッジ時間 | 2,206 ms |
ジャッジサーバーID (参考情報) |
judge2 / 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;namespace _0123{class Program{static void Main(string[] args){var _ = Console.ReadLine().Split();var n = int.Parse(_[0]);var m = int.Parse(_[1]);var a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();var l = Enumerable.Range(1,n).ToList();for(var i = 0; i < m; i++){var t = l[a[i]-1];l.Remove(t);l.Insert(0,t);}Console.WriteLine(l[0]);}}}