結果

問題 No.123 カードシャッフル
ユーザー 明智重蔵
提出日時 2015-08-15 09:59:32
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 73 ms / 5,000 ms
コード長 2,736 bytes
コンパイル時間 1,114 ms
コンパイル使用メモリ 114,888 KB
実行使用メモリ 32,132 KB
最終ジャッジ日時 2024-07-18 09:38:33
合計ジャッジ時間 2,137 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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.

ソースコード

diff #
プレゼンテーションモードにする

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static string InputPattern = "Input5";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("3 1");
WillReturn.Add("2");
//2
//1331,2,3
//122
//2
}
else if (InputPattern == "Input2") {
WillReturn.Add("3 2");
WillReturn.Add("3 2");
//1
//1331,2,3
//133
//3,1,2
//221
//1
}
else if (InputPattern == "Input3") {
WillReturn.Add("4 4");
WillReturn.Add("1 1 1 1");
//1
//1441,2,3,4
// 14
//1
}
else if (InputPattern == "Input4") {
WillReturn.Add("10 8");
WillReturn.Add("6 10 4 2 7 1 4 3");
//10
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
static void Main()
{
List<string> InputList = GetInputList();
int[] wkArr = InputList[0].Split(' ').Select(X => int.Parse(X)).ToArray();
List<int> NList = Enumerable.Range(1, wkArr[0]).ToList();
int[] AArr = InputList[1].Split(' ').Select(X => int.Parse(X)).ToArray();
Action<int> ShuffleAct = (pInd) =>
{
int SaveInt = NList[pInd];
NList.RemoveAt(pInd);
NList.Insert(0, SaveInt);
};
Array.ForEach(AArr, X => ShuffleAct(X - 1));
Console.WriteLine(NList[0]);
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0