結果

問題 No.123 カードシャッフル
ユーザー nak2yoshi
提出日時 2016-02-21 20:54:16
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 845 ms
コンパイル使用メモリ 104,004 KB
実行使用メモリ 5,512 KB
最終ジャッジ日時 2024-06-12 02:58:09
合計ジャッジ時間 1,633 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio,
       std.conv,
       std.string,
       std.range,
       std.math,
       std.algorithm;

void main()
{
    auto input = readln.split.to!(int[]);
    auto N = input[0], M = input[1];
    auto A = readln.split.to!(int[]);
    auto card = 1.iota(N + 1).array;

    A.each!(i => card=card[i-1]~card[0..i-1]~card[i..$]);
    card[0].writeln;
}
0