結果

問題 No.123 カードシャッフル
ユーザー むらためむらため
提出日時 2019-01-17 04:39:13
言語 Nim
(2.0.2)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 2,507 ms
コンパイル使用メモリ 70,692 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-13 22:27:22
合計ジャッジ時間 3,390 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 15 ms
4,376 KB
testcase_11 AC 57 ms
4,380 KB
testcase_12 AC 57 ms
4,380 KB
testcase_13 AC 57 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
  result = 0
  while true:
    var k = getchar_unlocked()
    if k < '0' or k > '9': break
    else: result = 10 * result + k.ord - '0'.ord
let n = scan()
let m = scan()
var C = toSeq(1..n)
for _ in 0..<m:
  let a = scan()
  C = C[a-1] & C[0..<a-1] & C[a..^1]
echo C[0]
0