結果
問題 | No.742 にゃんにゃんにゃん 猫の挨拶 |
ユーザー |
👑 |
提出日時 | 2019-04-28 11:42:20 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 1,810 ms / 2,500 ms |
コード長 | 385 bytes |
コンパイル時間 | 274 ms |
コンパイル使用メモリ | 6,820 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-15 08:32:14 |
合計ジャッジ時間 | 3,337 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
ior = io.readlocal n = ior("*n")local dst = {}local cnt = 0for i = 1, n dodst[i] = ior("*n")endfor i = 1, n - 1 dolocal di = dst[i]if(i < n / 3) thenlocal a = di - 1for j = 1, i - 1 doif(dst[j] < di) then a = a - 1 endendcnt = cnt + aelsefor j = i + 1, n doif(dst[j] <= di) then cnt = cnt + 1 endendendendprint(cnt)