mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-13 16:17:54 +00:00
Docs: Update benchmark for openai/gpt-5.1-codex-max
This commit is contained in:
22
tests/2_convex_hull/outputs/openai_gpt-5.1-codex-max.js
Normal file
22
tests/2_convex_hull/outputs/openai_gpt-5.1-codex-max.js
Normal file
@@ -0,0 +1,22 @@
|
||||
async function findConvexHull(a) {
|
||||
const { sortBy, uniqWith, isEqual } = await import('https://cdn.jsdelivr.net/npm/lodash-es@4.17.21/lodash.js');
|
||||
a = uniqWith(a, isEqual);
|
||||
if (a.length < 4) return a;
|
||||
const b = sortBy(a, [v => v.x, v => v.y]);
|
||||
const c = (o, p, q) => (p.x - o.x) * (q.y - o.y) - (p.y - o.y) * (q.x - o.x);
|
||||
const d = [];
|
||||
for (const p of b) {
|
||||
while (d.length > 1 && c(d[d.length - 2], d[d.length - 1], p) <= 0) d.pop();
|
||||
d.push(p);
|
||||
}
|
||||
const e = [];
|
||||
for (let i = b.length; i--;) {
|
||||
const p = b[i];
|
||||
while (e.length > 1 && c(e[e.length - 2], e[e.length - 1], p) <= 0) e.pop();
|
||||
e.push(p);
|
||||
}
|
||||
return uniqWith([...d, ...e], isEqual);
|
||||
}
|
||||
export default findConvexHull;
|
||||
// Generation time: 16.314s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user