結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2018-04-30 13:26:49 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 395 bytes |
コンパイル時間 | 45 ms |
コンパイル使用メモリ | 5,248 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 23:52:14 |
合計ジャッジ時間 | 1,720 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
local ffi = require 'ffi'print((function (f, n)local a,r,t = ffi.new("int8_t[?]",n),0,0for i=0,n-1 do a[i]=1 endfor _=1,n do f(a) endfor i=0,n-1 do if a[i]==1 then r,t=i,t+1 end endreturn t==1 and r+1 or -1end)(function (a)local i=0for e in io.stdin:read("*l"):gmatch("[%-%w]+") doif e~="-" and e~="nyanpass" then a[i]=0 endi=i+1endend, tonumber(io.stdin:read("*l"))))