結果

問題 No.123 カードシャッフル
ユーザー 826814741_6826814741_6
提出日時 2018-12-30 12:40:17
言語 Lua
(LuaJit 2.1.1696795921)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 01:52:41
合計ジャッジ時間 743 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

print((function (M)
	M.cdef 'int scanf(const char*, ...);'
	local C,c,a,n = M.C,M.new("char[1]"),{}
	C.scanf("%d",c) n=c[0] for i=1,n do a[i]=n+1-i end
	C.scanf("%d",c) for _=1,c[0] do
		C.scanf("%d",c) local t=a[n+1-c[0]]
		for i=n+1-c[0],n-1 do a[i]=a[i+1] end a[n]=t
	end
	return a[n]
end)(require'ffi'))
0