tested-best-bank-v2-reviewed
Separate measurement contract · 1 measured cohort · 07a1f808bc18
| Measured UTC | Pass rate | 95% band | Attempts | Responses | Provider failures | Median latency | Capped / refusal flags | Receipts |
|---|---|---|---|---|---|---|---|---|
| 2026-10-05 05:54 | 97.2% | 88.9%–100.0% | 36 / 36 | 36 / 36 | 0 | 4.96 s | 0 / 0 | Original JSON |
Measurement contract and limitations
- Task-bank SHA-256
- fce29b4d66cfddeab39632d451935271a37df595374b40eacd300201e3726291
- Protocol SHA-256
- 90b114dd8a70ecbf3aecc35f58cea1ba85c786554aee9835a38a1c518293da05
- Grader contract
- 62980813a06357fd89c914858db26855ffe2bd65a7e18f326d827fb6610e7e23
- Model configuration
- 04e4af3ce275b597cf00f2c7dc53d1c4bd14f4df1016870506fb403d1da26a0e
One point is one cohort, not a week of daily tests.
Exact returned model identity was validated by the source runner; the public projection exposes the admitted ID and response hash.
Hidden fixtures and private transport responses remain with the source owner.
Inspect 36 retained attempts
coding-csv · repeat 1 · Pass
checked · responded · 2026-10-05T05:42:44.112924+00:00 UTC
Request: Not exposed. Estimated cost: US$0.010111. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is CSV text with header customer,cents, including quoted fields. Treat a customer containing only whitespace as blank. Trim surrounding whitespace from cents, then accept only an optional ASCII + or - followed by one or more ASCII digits 0-9. Ignore blank customers and invalid cents. Sum by customer and return a dictionary, including zero totals. Preserve customer spelling. CSV quoting is valid and the header is exactly customer,cents. Ignore rows missing either field or containing extra fields. Ignore empty lines. Whitespace means Python str.strip() whitespace. No dictionary key order is required.
Retained output
import csv
import io
import re
from collections import defaultdict
def solve(data):
f = io.StringIO(data)
reader = csv.reader(f)
cents_pattern = re.compile(r'^[+-]?[0-9]+$')
totals = defaultdict(int)
header_seen = False
for row in reader:
if not row:
continue
if not header_seen:
if row == ['customer', 'cents']:
header_seen = True
continue
if len(row) != 2:
continue
cust, cents_raw = row
if not cust.strip():
continue
cents_str = cents_raw.strip()
if not cents_pattern.fullmatch(cents_str):
continue
totals[cust] += int(cents_str)
return dict(totals)Response SHA-256: 504712a08b713af913ab1e67ee42c0fb9179751a3d94031487346d9c04715d28
coding-rolling · repeat 3 · Pass
checked · responded · 2026-10-05T05:50:49.181567+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004995. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {events:[[day,count],...], query_days:[integer,...]}. Return totals for each query day covering inclusive days q-6 through q. Events can be unsorted, repeated or negative-day; count is nonnegative. Query order must be preserved. Days, query days and counts are integers.Retained output
from collections import defaultdict
def solve(data):
events = data.get("events", [])
query_days = data.get("query_days", [])
day_counts = defaultdict(int)
for day, count in events:
day_counts[day] += count
return [
sum(day_counts.get(d, 0) for d in range(q - 6, q + 1))
for q in query_days
]Response SHA-256: bc333f279200949deb87ca75561c60d744b9ec2f293e0d92c93eff465186ae57
coding-csv · repeat 3 · Pass
checked · responded · 2026-10-05T05:52:18.630084+00:00 UTC
Request: Not exposed. Estimated cost: US$0.013437. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is CSV text with header customer,cents, including quoted fields. Treat a customer containing only whitespace as blank. Trim surrounding whitespace from cents, then accept only an optional ASCII + or - followed by one or more ASCII digits 0-9. Ignore blank customers and invalid cents. Sum by customer and return a dictionary, including zero totals. Preserve customer spelling. CSV quoting is valid and the header is exactly customer,cents. Ignore rows missing either field or containing extra fields. Ignore empty lines. Whitespace means Python str.strip() whitespace. No dictionary key order is required.
Retained output
import csv
import io
import re
def solve(data):
pattern = re.compile(r'[+-]?[0-9]+')
totals = {}
header_seen = False
for row in csv.reader(io.StringIO(data)):
if not header_seen:
if row == ['customer', 'cents']:
header_seen = True
continue
if len(row) != 2:
continue
customer, cents = row
if not customer.strip():
continue
cents_trimmed = cents.strip()
if not pattern.fullmatch(cents_trimmed):
continue
val = int(cents_trimmed)
totals[customer] = totals.get(customer, 0) + val
return totalsResponse SHA-256: 4e83124db288aa5be60a0cf11343edf8a58f833fd1a274f9e1fbbf8e5161d624
coding-intervals · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:29.504861+00:00 UTC
Request: Not exposed. Estimated cost: US$0.005256. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of [start,end] integer half-open intervals, with start<=end. Drop empty intervals; merge overlapping or touching intervals. Return sorted merged intervals without mutating input.
Retained output
def solve(data):
valid = sorted([[iv[0], iv[1]] for iv in data if iv[0] < iv[1]])
if not valid:
return []
merged = []
for iv in valid:
if not merged:
merged.append([iv[0], iv[1]])
elif iv[0] <= merged[-1][1]:
merged[-1][1] = max(merged[-1][1], iv[1])
else:
merged.append([iv[0], iv[1]])
return mergedResponse SHA-256: 0bf511b37a23bd169f96d417ac80af2072ad4779f01d5c6469cab1330183c9b0
coding-slug · repeat 3 · Pass
checked · responded · 2026-10-05T05:53:33.843069+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004968. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a string. Apply Unicode NFKD normalization, drop combining marks, lowercase, retain only ASCII a-z and digits, replace each run of other characters with one hyphen, strip edge hyphens. Return the slug.
Retained output
import re
import unicodedata
def solve(data):
normalized = unicodedata.normalize('NFKD', data)
no_combining = ''.join(c for c in normalized if not unicodedata.combining(c))
lowered = no_combining.lower()
return re.sub(r'[^a-z0-9]+', '-', lowered).strip('-')Response SHA-256: 0bca434544395548eddfc85ca41adc092b65f2f0c994166067974fd0e3ef72c8
coding-intervals · repeat 2 · Pass
checked · responded · 2026-10-05T05:48:50.607164+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004274. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of [start,end] integer half-open intervals, with start<=end. Drop empty intervals; merge overlapping or touching intervals. Return sorted merged intervals without mutating input.
Retained output
def solve(data):
filtered = sorted([[iv[0], iv[1]] for iv in data if iv[0] < iv[1]])
if not filtered:
return []
merged = [filtered[0]]
for iv in filtered[1:]:
if iv[0] <= merged[-1][1]:
merged[-1][1] = max(merged[-1][1], iv[1])
else:
merged.append(iv)
return mergedResponse SHA-256: b2f39b81ef4b5e5844b0fa8144e058279d7e6ac8a10febd65cb1e11e230b1185
coding-rate · repeat 2 · Pass
checked · responded · 2026-10-05T05:47:26.183588+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004656. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {limit:positive integer,window:positive integer,events:[{user,time},...]}. Times are nondecreasing integer seconds. Process in input order. Accept only when fewer than limit previously accepted events for that user have times strictly greater than time-window. Rejections do not consume allowance. Return a list of booleans. User IDs are strings.Retained output
from collections import deque, defaultdict
def solve(data):
limit = data['limit']
window = data['window']
events = data['events']
user_history = defaultdict(deque)
results = []
for ev in events:
user = ev['user']
t = ev['time']
dq = user_history[user]
cutoff = t - window
while dq and dq[0] <= cutoff:
dq.popleft()
if len(dq) < limit:
dq.append(t)
results.append(True)
else:
results.append(False)
return resultsResponse SHA-256: 9fd957a22f505c8d8e2febc38338f852d29c8ece13053b598cadb01ea217b450
coding-rate · repeat 3 · Pass
checked · responded · 2026-10-05T05:53:21.252966+00:00 UTC
Request: Not exposed. Estimated cost: US$0.005451. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {limit:positive integer,window:positive integer,events:[{user,time},...]}. Times are nondecreasing integer seconds. Process in input order. Accept only when fewer than limit previously accepted events for that user have times strictly greater than time-window. Rejections do not consume allowance. Return a list of booleans. User IDs are strings.Retained output
from collections import defaultdict, deque
def solve(data):
limit = data['limit']
window = data['window']
events = data['events']
user_history = defaultdict(deque)
result = []
for ev in events:
u = ev['user']
t = ev['time']
q = user_history[u]
cutoff = t - window
while q and q[0] <= cutoff:
q.popleft()
if len(q) < limit:
q.append(t)
result.append(True)
else:
result.append(False)
return resultResponse SHA-256: d3ec2c313821c9bf1258d7ad291c5cc72f282cf05d4eba36c087a78c960a9173
coding-allocate · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:08.097476+00:00 UTC
Request: Not exposed. Estimated cost: US$0.005601. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {total:nonnegative integer,weights:[nonnegative integer,...]}. Allocate proportionally using largest remainders: floor each share, then give leftover cents to largest fractional remainders, ties to lower index. If weights empty return []; if all zero return zeros.Retained output
def solve(data):
weights = data["weights"]
total = data["total"]
if not weights:
return []
sum_w = sum(weights)
if sum_w == 0:
return [0] * len(weights)
shares = [0] * len(weights)
rems = [0] * len(weights)
for i, w in enumerate(weights):
q, r = divmod(total * w, sum_w)
shares[i] = q
rems[i] = r
leftover = total - sum(shares)
sorted_indices = sorted(range(len(weights)), key=lambda i: (-rems[i], i))
for idx in sorted_indices[:leftover]:
shares[idx] += 1
return sharesResponse SHA-256: 80912bd390390f95fafe1adb0c55930ff2135e30a8640b448f1e5bbfe5043c23
coding-slug · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:20.389474+00:00 UTC
Request: Not exposed. Estimated cost: US$0.003018. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a string. Apply Unicode NFKD normalization, drop combining marks, lowercase, retain only ASCII a-z and digits, replace each run of other characters with one hyphen, strip edge hyphens. Return the slug.
Retained output
import unicodedata
import re
def solve(data):
normalized = unicodedata.normalize('NFKD', data)
without_combining = ''.join(c for c in normalized if not unicodedata.combining(c))
lowered = without_combining.lower()
hyphenated = re.sub(r'[^a-z0-9]+', '-', lowered)
return hyphenated.strip('-')Response SHA-256: 6d74246d013fc7d2e2237b68b9cec7b03bc76c1932366cc254c0346124b37042
coding-percentile · repeat 1 · Pass
checked · responded · 2026-10-05T05:41:43.115314+00:00 UTC
Request: Not exposed. Estimated cost: US$0.007392. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {values:[finite numbers,...],p:number in [0,100]}. Return nearest-rank percentile: sorted values at 1-based rank max(1,ceil(p/100*n)). Return null for no values. Do not interpolate or mutate input.Retained output
import math
def solve(data):
values = data['values']
if not values:
return None
p = data['p']
n = len(values)
rank = max(1, math.ceil(p / 100 * n))
return sorted(values)[rank - 1]Response SHA-256: f86abc3802b856115f14771f68a20dc3c105edd5112c1ec72533fff5ea429c2d
coding-dedup · repeat 2 · Pass
checked · responded · 2026-10-05T05:50:04.844746+00:00 UTC
Request: Not exposed. Estimated cost: US$0.005049. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of {id, version, value}. Keep the highest version for each id; on equal version keep the last occurrence. Return the retained objects sorted lexicographically by id. Do not mutate the input. IDs are strings, versions are integers, and values are arbitrary JSON.Retained output
def solve(data):
best = {}
for item in data:
item_id = item['id']
item_ver = item['version']
if item_id not in best or item_ver >= best[item_id][0]:
best[item_id] = (item_ver, item)
return [best[k][1] for k in sorted(best.keys())]Response SHA-256: 81b7db0d8ff3625c6f7fc843a990ddad84b670ca227e870daef7b535069311b3
coding-fifo · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:52.901468+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004063. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {lots:[[quantity,unit_cents],...], sold:nonnegative integer}. Sell in lot order. Return {remaining_units,remaining_value_cents,unfilled_units}. All quantities/prices nonnegative; unfilled is sales beyond available inventory. Quantities and unit prices are integers.Retained output
def solve(data):
lots = data["lots"]
current_sold = data["sold"]
rem_units = 0
rem_value = 0
for lot in lots:
qty = lot[0]
price = lot[1]
take = min(current_sold, qty)
current_sold -= take
remaining = qty - take
rem_units += remaining
rem_value += remaining * price
return {
"remaining_units": rem_units,
"remaining_value_cents": rem_value,
"unfilled_units": current_sold,
}Response SHA-256: 9552a1bbc728b9d3888743fca46a718abff3c85bdead8f8521a29517e778c156
coding-percentile · repeat 2 · Pass
checked · responded · 2026-10-05T05:48:13.359370+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004650. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {values:[finite numbers,...],p:number in [0,100]}. Return nearest-rank percentile: sorted values at 1-based rank max(1,ceil(p/100*n)). Return null for no values. Do not interpolate or mutate input.Retained output
import math
def solve(data):
values = sorted(data["values"])
if not values:
return None
n = len(values)
p = data["p"]
rank = max(1, math.ceil(p / 100 * n))
return values[rank - 1]Response SHA-256: 24c22ce48c161aed0e129c59843fc760f5dd65fbb4450532ac8c7b0c74561cea
coding-redact · repeat 3 · Pass
checked · responded · 2026-10-05T05:54:20.858454+00:00 UTC
Request: Not exposed. Estimated cost: US$0.003582. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is arbitrary JSON. Recursively remove dictionary keys whose lowercase spelling equals password, token or secret. Preserve other values and list order; never mutate the original.
Retained output
def solve(data):
if isinstance(data, dict):
return {
k: solve(v)
for k, v in data.items()
if not (isinstance(k, str) and k.lower() in ('password', 'token', 'secret'))
}
if isinstance(data, list):
return [solve(item) for item in data]
return dataResponse SHA-256: 457cd856e850db57cc759c69d60bd2c7759015d567cb619ca03a81619d5d7e96
coding-allocate · repeat 3 · Pass
checked · responded · 2026-10-05T05:53:59.364110+00:00 UTC
Request: Not exposed. Estimated cost: US$0.005619. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {total:nonnegative integer,weights:[nonnegative integer,...]}. Allocate proportionally using largest remainders: floor each share, then give leftover cents to largest fractional remainders, ties to lower index. If weights empty return []; if all zero return zeros.Retained output
def solve(data):
total = data["total"]
weights = data["weights"]
if not weights:
return []
w_sum = sum(weights)
if w_sum == 0:
return [0] * len(weights)
shares = [(total * w) // w_sum for w in weights]
rems = [(total * w) % w_sum for w in weights]
leftover = total - sum(shares)
order = sorted(range(len(weights)), key=lambda i: (-rems[i], i))
for i in range(leftover):
shares[order[i]] += 1
return sharesResponse SHA-256: 40eaebf0d548484b82c94346022db5558e866dfd04f63170a7eb96a4b8df6c19
coding-allocate · repeat 2 · Pass
checked · responded · 2026-10-05T05:47:10.465997+00:00 UTC
Request: Not exposed. Estimated cost: US$0.006043. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {total:nonnegative integer,weights:[nonnegative integer,...]}. Allocate proportionally using largest remainders: floor each share, then give leftover cents to largest fractional remainders, ties to lower index. If weights empty return []; if all zero return zeros.Retained output
def solve(data):
total = data['total']
weights = data['weights']
if not weights:
return []
s = sum(weights)
if s == 0:
return [0] * len(weights)
bases = [total * w // s for w in weights]
rems = [total * w % s for w in weights]
leftover = total - sum(bases)
order = sorted(range(len(weights)), key=lambda i: (-rems[i], i))
res = list(bases)
for i in range(leftover):
res[order[i]] += 1
return resResponse SHA-256: 613202f62c4ce0a26f1f6b9677a2aa24e4ccaa7ba99eb9c3a2dc7f6939d709c1
coding-fifo · repeat 2 · Pass
checked · responded · 2026-10-05T05:49:31.044804+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004108. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {lots:[[quantity,unit_cents],...], sold:nonnegative integer}. Sell in lot order. Return {remaining_units,remaining_value_cents,unfilled_units}. All quantities/prices nonnegative; unfilled is sales beyond available inventory. Quantities and unit prices are integers.Retained output
def solve(data):
lots = data["lots"]
to_sell = data["sold"]
rem_units = 0
rem_value = 0
for lot in lots:
qty = lot[0]
price = lot[1]
if to_sell > 0:
take = min(qty, to_sell)
left = qty - take
to_sell -= take
else:
left = qty
rem_units += left
rem_value += left * price
return {
"remaining_units": rem_units,
"remaining_value_cents": rem_value,
"unfilled_units": to_sell,
}Response SHA-256: a9284be695742c01928ccd1f66bb9e5670be94f2c00ee6a81e2ca23279fb4673
coding-csv · repeat 2 · Pass
checked · responded · 2026-10-05T05:49:11.842179+00:00 UTC
Request: Not exposed. Estimated cost: US$0.007344. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is CSV text with header customer,cents, including quoted fields. Treat a customer containing only whitespace as blank. Trim surrounding whitespace from cents, then accept only an optional ASCII + or - followed by one or more ASCII digits 0-9. Ignore blank customers and invalid cents. Sum by customer and return a dictionary, including zero totals. Preserve customer spelling. CSV quoting is valid and the header is exactly customer,cents. Ignore rows missing either field or containing extra fields. Ignore empty lines. Whitespace means Python str.strip() whitespace. No dictionary key order is required.
Retained output
import csv
import io
import re
def solve(data):
cents_pattern = re.compile(r'^[+-]?[0-9]+$')
f = io.StringIO(data)
reader = csv.reader(f)
header_found = False
totals = {}
for row in reader:
if not row:
continue
if not header_found:
if row == ['customer', 'cents']:
header_found = True
continue
if len(row) != 2:
continue
customer, cents = row
if not customer.strip():
continue
cents_trimmed = cents.strip()
if not cents_pattern.fullmatch(cents_trimmed):
continue
val = int(cents_trimmed)
totals[customer] = totals.get(customer, 0) + val
return totalsResponse SHA-256: 708ec57d7f969723ddd3a249b4d49b06b323817a046af7d61578d7666958c6fb
coding-dedup · repeat 3 · Pass
checked · responded · 2026-10-05T05:53:03.956244+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004074. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of {id, version, value}. Keep the highest version for each id; on equal version keep the last occurrence. Return the retained objects sorted lexicographically by id. Do not mutate the input. IDs are strings, versions are integers, and values are arbitrary JSON.Retained output
def solve(data):
best = {}
for item in data:
item_id = item['id']
version = item['version']
if item_id not in best or version >= best[item_id]['version']:
best[item_id] = item
return [dict(best[k]) for k in sorted(best.keys())]Response SHA-256: 494da414924a085e0ff62efbac5ed678fe4cefe30262bfb0b66826c89a8650ed
coding-redact · repeat 1 · Pass
checked · responded · 2026-10-05T05:42:52.261495+00:00 UTC
Request: Not exposed. Estimated cost: US$0.003612. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is arbitrary JSON. Recursively remove dictionary keys whose lowercase spelling equals password, token or secret. Preserve other values and list order; never mutate the original.
Retained output
def solve(data):
if isinstance(data, dict):
return {
k: solve(v)
for k, v in data.items()
if not (isinstance(k, str) and k.lower() in ("password", "token", "secret"))
}
if isinstance(data, list):
return [solve(item) for item in data]
return dataResponse SHA-256: 6d9d230fd318f1f961b85edabbc2c592b65a64101e0bf129c4e64a41ad8351c3
coding-reconcile · repeat 2 · Fail
execution_rejected · responded · 2026-10-05T05:48:58.361474+00:00 UTC
Request: Not exposed. Estimated cost: US$0.003715. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input has invoices and payments lists of {id, cents}. Sum amounts by id; payments subtract from invoices. Return a dict of nonzero outstanding amounts with dictionary iteration keys sorted lexicographically by id, including negative overpayments. IDs are strings. Empty lists are valid. Amounts in cents are integers.Retained output
from collections import defaultdict
def solve(data):
balances = defaultdict(int)
for inv in data.get('invoices', []):
balances[inv['id']] += inv['cents']
for pmt in data.get('payments', []):
balances[pmmt_id := pmt['id']] -= pmt['cents']
result = {}
for k in sorted(balances):
val = balances[k]
if val != 0:
result[k] = val
return resultResponse SHA-256: b640cc01457c8b61878798d8ad15af1e09484e4c367c1ea65cb8eb26da8f945a
coding-dedup · repeat 1 · Pass
checked · responded · 2026-10-05T05:42:15.020643+00:00 UTC
Request: Not exposed. Estimated cost: US$0.008754. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of {id, version, value}. Keep the highest version for each id; on equal version keep the last occurrence. Return the retained objects sorted lexicographically by id. Do not mutate the input. IDs are strings, versions are integers, and values are arbitrary JSON.Retained output
def solve(data):
best = {}
for item in data:
item_id = item['id']
ver = item['version']
if item_id not in best or ver >= best[item_id]['version']:
best[item_id] = item
return [best[k] for k in sorted(best)]Response SHA-256: 453f95eb457ac4502c451278534d9b9d84e57c55feeaa8d6d480302dafcc6cc8
coding-intervals · repeat 3 · Pass
checked · responded · 2026-10-05T05:50:34.844604+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004045. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a list of [start,end] integer half-open intervals, with start<=end. Drop empty intervals; merge overlapping or touching intervals. Return sorted merged intervals without mutating input.
Retained output
def solve(data):
non_empty = [list(interval) for interval in data if interval[0] < interval[1]]
non_empty.sort(key=lambda x: (x[0], x[1]))
merged = []
for interval in non_empty:
if not merged:
merged.append(interval)
else:
if interval[0] <= merged[-1][1]:
merged[-1][1] = max(merged[-1][1], interval[1])
else:
merged.append(interval)
return mergedResponse SHA-256: 71e9bcccd4e62e57967c96a3b0d8bafa54c6ccfeda63f82713b264b2723c8e4f
coding-rolling · repeat 2 · Pass
checked · responded · 2026-10-05T05:46:52.762328+00:00 UTC
Request: Not exposed. Estimated cost: US$0.002700. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {events:[[day,count],...], query_days:[integer,...]}. Return totals for each query day covering inclusive days q-6 through q. Events can be unsorted, repeated or negative-day; count is nonnegative. Query order must be preserved. Days, query days and counts are integers.Retained output
from collections import defaultdict
def solve(data):
events = data.get("events", [])
query_days = data.get("query_days", [])
day_counts = defaultdict(int)
for day, count in events:
day_counts[day] += count
result = []
for q in query_days:
total = sum(day_counts[d] for d in range(q - 6, q + 1))
result.append(total)
return resultResponse SHA-256: c14a523cfae66df8cb800c4593f14c07a10a8a5367e288055455a70a304ba1c5
coding-slug · repeat 2 · Pass
checked · responded · 2026-10-05T05:47:34.260101+00:00 UTC
Request: Not exposed. Estimated cost: US$0.003555. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a string. Apply Unicode NFKD normalization, drop combining marks, lowercase, retain only ASCII a-z and digits, replace each run of other characters with one hyphen, strip edge hyphens. Return the slug.
Retained output
import re
import unicodedata
def solve(data):
normalized = unicodedata.normalize('NFKD', data)
no_combining = ''.join(c for c in normalized if not unicodedata.combining(c))
lowered = no_combining.lower()
slug = re.sub(r'[^a-z0-9]+', '-', lowered)
return slug.strip('-')Response SHA-256: 7b7ac7c1628b600ec4f3f003968a1cec5cda662348f2d3b72336c3822d2207c3
coding-dependencies · repeat 3 · Pass
checked · responded · 2026-10-05T05:53:47.477761+00:00 UTC
Request: Not exposed. Estimated cost: US$0.007697. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a dict mapping each named job to prerequisite names. Include names referenced only as prerequisites. Return the lexicographically smallest valid topological order, choosing the smallest ready name at every step. Return null for any cycle. Job and prerequisite names are strings; prerequisites are lists. Repeated names in a prerequisite list denote the same dependency. Referenced-only names have no prerequisites. A self-dependency is a cycle. Return Python None for a cycle.
Retained output
import heapq
def solve(data):
all_nodes = set(data.keys())
for prereqs in data.values():
all_nodes.update(prereqs)
adj = {node: [] for node in all_nodes}
in_degree = {}
for job in all_nodes:
prereqs = set(data.get(job, []))
in_degree[job] = len(prereqs)
for p in prereqs:
adj[p].append(job)
heap = [node for node, deg in in_degree.items() if deg == 0]
heapq.heapify(heap)
result = []
while heap:
curr = heapq.heappop(heap)
result.append(curr)
for nxt in adj[curr]:
in_degree[nxt] -= 1
if in_degree[nxt] == 0:
heapq.heappush(heap, nxt)
if len(result) == len(all_nodes):
return result
return NoneResponse SHA-256: d484ff523a117011a89dcb8705fa13ae3c2b8a280ee057cb093e6c1e7d8e25c9
coding-reconcile · repeat 3 · Pass
checked · responded · 2026-10-05T05:51:58.222229+00:00 UTC
Request: Not exposed. Estimated cost: US$0.003231. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input has invoices and payments lists of {id, cents}. Sum amounts by id; payments subtract from invoices. Return a dict of nonzero outstanding amounts with dictionary iteration keys sorted lexicographically by id, including negative overpayments. IDs are strings. Empty lists are valid. Amounts in cents are integers.Retained output
from collections import defaultdict
def solve(data):
balances = defaultdict(int)
for inv in data["invoices"]:
balances[inv["id"]] += inv["cents"]
for pmt in data["payments"]:
balances[pmt["id"]] -= pmt["cents"]
result = {}
for k in sorted(balances):
val = balances[k]
if val != 0:
result[k] = val
return resultResponse SHA-256: 11832f66e632b38b0b49913e83184dfd8d8e5f13578cb420f8bba5005c1dd6ae
coding-dependencies · repeat 2 · Pass
checked · responded · 2026-10-05T05:48:40.306451+00:00 UTC
Request: Not exposed. Estimated cost: US$0.006039. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a dict mapping each named job to prerequisite names. Include names referenced only as prerequisites. Return the lexicographically smallest valid topological order, choosing the smallest ready name at every step. Return null for any cycle. Job and prerequisite names are strings; prerequisites are lists. Repeated names in a prerequisite list denote the same dependency. Referenced-only names have no prerequisites. A self-dependency is a cycle. Return Python None for a cycle.
Retained output
from collections import defaultdict
from heapq import heappop, heappush, heapify
def solve(data):
all_nodes = set(data.keys())
for prereqs in data.values():
all_nodes.update(prereqs)
in_degree = {node: 0 for node in all_nodes}
adj = defaultdict(list)
for node, prereqs in data.items():
unique_prereqs = set(prereqs)
in_degree[node] = len(unique_prereqs)
for p in unique_prereqs:
adj[p].append(node)
heap = [node for node, deg in in_degree.items() if deg == 0]
heapify(heap)
result = []
while heap:
curr = heappop(heap)
result.append(curr)
for neighbor in adj[curr]:
in_degree[neighbor] -= 1
if in_degree[neighbor] == 0:
heappush(heap, neighbor)
if len(result) == len(all_nodes):
return result
return NoneResponse SHA-256: 3aba05f4a1f11ee059e012b3507fb4f8c018fa1483cb24f77b72ec1aac112465
coding-fifo · repeat 3 · Pass
checked · responded · 2026-10-05T05:50:24.955592+00:00 UTC
Request: Not exposed. Estimated cost: US$0.003448. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {lots:[[quantity,unit_cents],...], sold:nonnegative integer}. Sell in lot order. Return {remaining_units,remaining_value_cents,unfilled_units}. All quantities/prices nonnegative; unfilled is sales beyond available inventory. Quantities and unit prices are integers.Retained output
def solve(data):
to_sell = data["sold"]
remaining_units = 0
remaining_value_cents = 0
for lot in data["lots"]:
qty = lot[0]
price = lot[1]
take = min(to_sell, qty)
rem = qty - take
to_sell -= take
remaining_units += rem
remaining_value_cents += rem * price
return {
"remaining_units": remaining_units,
"remaining_value_cents": remaining_value_cents,
"unfilled_units": to_sell,
}Response SHA-256: d4c758253c0efaa777d0ea31d02d6ed1a55fef43680bc97680e2a9143cef58fe
coding-reconcile · repeat 1 · Pass
checked · responded · 2026-10-05T05:44:20.205735+00:00 UTC
Request: Not exposed. Estimated cost: US$0.002939. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input has invoices and payments lists of {id, cents}. Sum amounts by id; payments subtract from invoices. Return a dict of nonzero outstanding amounts with dictionary iteration keys sorted lexicographically by id, including negative overpayments. IDs are strings. Empty lists are valid. Amounts in cents are integers.Retained output
from collections import defaultdict
def solve(data):
totals = defaultdict(int)
for inv in data.get('invoices', []):
totals[inv['id']] += inv['cents']
for pay in data.get('payments', []):
totals[pay['id']] -= pay['cents']
result = {}
for k in sorted(totals.keys()):
if totals[k] != 0:
result[k] = totals[k]
return resultResponse SHA-256: fdf827ee0a3e1b4aa7eea79c55f8fc6b5330e4cf47fe1160125708387c445f43
coding-rolling · repeat 1 · Pass
checked · responded · 2026-10-05T05:45:43.280652+00:00 UTC
Request: Not exposed. Estimated cost: US$0.007533. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {events:[[day,count],...], query_days:[integer,...]}. Return totals for each query day covering inclusive days q-6 through q. Events can be unsorted, repeated or negative-day; count is nonnegative. Query order must be preserved. Days, query days and counts are integers.Retained output
from collections import defaultdict
def solve(data):
events = data.get("events", [])
query_days = data.get("query_days", [])
day_counts = defaultdict(int)
for day, count in events:
day_counts[day] += count
sorted_days = sorted(day_counts.keys())
prefix = [0]
for d in sorted_days:
prefix.append(prefix[-1] + day_counts[d])
def b_left(a, x):
lo = 0
hi = len(a)
while lo < hi:
mid = (lo + hi) // 2
if a[mid] < x:
lo = mid + 1
else:
hi = mid
return lo
def b_right(a, x):
lo = 0
hi = len(a)
while lo < hi:
mid = (lo + hi) // 2
if x < a[mid]:
hi = mid
else:
lo = mid + 1
return lo
ans = []
for q in query_days:
l = b_left(sorted_days, q - 6)
r = b_right(sorted_days, q)
ans.append(prefix[r] - prefix[l])
return ansResponse SHA-256: 52fcb137061e28d2b1426e6bbe5596a424850698e7ca2ae326538e1515cdfd02
coding-percentile · repeat 3 · Pass
checked · responded · 2026-10-05T05:52:30.351151+00:00 UTC
Request: Not exposed. Estimated cost: US$0.005944. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {values:[finite numbers,...],p:number in [0,100]}. Return nearest-rank percentile: sorted values at 1-based rank max(1,ceil(p/100*n)). Return null for no values. Do not interpolate or mutate input.Retained output
import math
def solve(data):
values = data['values']
if not values:
return None
n = len(values)
p = data['p']
rank = max(1, math.ceil(p / 100 * n))
return sorted(values)[rank - 1]Response SHA-256: 17e60c30c5e797e985449fdadb2be86b305a14e82f359369fb94cc761901aba2
coding-dependencies · repeat 1 · Pass
checked · responded · 2026-10-05T05:44:33.119667+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004382. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is a dict mapping each named job to prerequisite names. Include names referenced only as prerequisites. Return the lexicographically smallest valid topological order, choosing the smallest ready name at every step. Return null for any cycle. Job and prerequisite names are strings; prerequisites are lists. Repeated names in a prerequisite list denote the same dependency. Referenced-only names have no prerequisites. A self-dependency is a cycle. Return Python None for a cycle.
Retained output
import heapq
from collections import defaultdict
def solve(data):
all_nodes = set(data.keys())
for prereqs in data.values():
all_nodes.update(prereqs)
in_degree = {node: 0 for node in all_nodes}
adj = defaultdict(list)
for job, prereqs in data.items():
unique_prereqs = set(prereqs)
in_degree[job] = len(unique_prereqs)
for p in unique_prereqs:
adj[p].append(job)
heap = [node for node, deg in in_degree.items() if deg == 0]
heapq.heapify(heap)
order = []
while heap:
u = heapq.heappop(heap)
order.append(u)
for v in adj[u]:
in_degree[v] -= 1
if in_degree[v] == 0:
heapq.heappush(heap, v)
if len(order) == len(all_nodes):
return order
return NoneResponse SHA-256: a3c9b0bb975a3c0b969bf532a79ddcf164d8d3e1caf1c9737c203946f1263a83
coding-redact · repeat 2 · Pass
checked · responded · 2026-10-05T05:48:22.324084+00:00 UTC
Request: Not exposed. Estimated cost: US$0.004194. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is arbitrary JSON. Recursively remove dictionary keys whose lowercase spelling equals password, token or secret. Preserve other values and list order; never mutate the original.
Retained output
def solve(data):
if isinstance(data, dict):
return {
k: solve(v)
for k, v in data.items()
if not (isinstance(k, str) and k.lower() in ('password', 'token', 'secret'))
}
if isinstance(data, list):
return [solve(v) for v in data]
return dataResponse SHA-256: 6c1670f237a23f65453915cc1cf3d1ae46fff7d74c844b29c6c61825907c1ddd
coding-rate · repeat 1 · Pass
checked · responded · 2026-10-05T05:43:02.527296+00:00 UTC
Request: Not exposed. Estimated cost: US$0.005125. Billed cost: unreconciled.
Exact prompt
Implement solve(data) in Python 3.9. Allowed imports are restricted module facades: math (public members); json (loads, dumps); csv (reader, DictReader); io (StringIO); re (compile, match, search, fullmatch, findall, finditer, split, sub, escape, IGNORECASE, MULTILINE, DOTALL, ASCII); collections (deque, defaultdict, Counter); heapq (heappush, heappop, heapify); unicodedata (normalize, combining, category). Other module members are unavailable. Use functions and only these safe built-ins: abs, all, any, bool, bytes, dict, divmod, enumerate, filter, float, frozenset, int, isinstance, len, list, map, max, min, next, ord, chr, pow, range, reversed, round, set, sorted, str, sum, tuple, zip, Exception, ValueError, TypeError, KeyError, IndexError, StopIteration. Import listed modules before referencing them. No custom classes, private/dunder attributes, globals/nonlocals, with statements, or async. Return only Python code, with no Markdown. Do not read files, use the network, run processes or access system state. Do not mutate any input, including nested containers. Return JSON-serializable values; Python None represents JSON null. Numeric strings and booleans are not accepted as numeric answers. Integer results are compared exactly; floating results use absolute tolerance 0.000001 or relative tolerance 0.00000001. Inputs follow the declared schema; no unspecified input validation is required. Input is {limit:positive integer,window:positive integer,events:[{user,time},...]}. Times are nondecreasing integer seconds. Process in input order. Accept only when fewer than limit previously accepted events for that user have times strictly greater than time-window. Rejections do not consume allowance. Return a list of booleans. User IDs are strings.Retained output
from collections import defaultdict, deque
def solve(data):
limit = data["limit"]
window = data["window"]
events = data["events"]
user_history = defaultdict(deque)
res = []
for event in events:
user = event["user"]
t = event["time"]
cutoff = t - window
dq = user_history[user]
while dq and dq[0] <= cutoff:
dq.popleft()
if len(dq) < limit:
dq.append(t)
res.append(True)
else:
res.append(False)
return resResponse SHA-256: 13abfdcd45d31ace7ace19090503ddf123e18b40643147fcd36b12a30c56f4fe