domain stringclasses 8
values | topic stringclasses 159
values | difficulty stringclasses 3
values | question stringlengths 5 14.3k | solution_trace listlengths 1 29 | answer stringlengths 1 87.4k | verification stringlengths 51 1.69k | common_pitfall stringlengths 82 816 | id stringlengths 16 16 |
|---|---|---|---|---|---|---|---|---|
Programming | - | hard | Implement the Strategy design pattern in JavaScript using a real-world e-commerce scenario. Show how it interacts with at least one other pattern. | [
"# Strategy + Observer Pattern in E-Commerce (JavaScript)",
"## The Scenario",
"A shopping cart needs to **process payments** through pluggable strategies (Credit Card, PayPal, Bank Transfer).",
"Each payment success or failure triggers a cascade of **notifications** to interested services (email, inventory, ... | # Strategy + Observer Pattern in E-Commerce (JavaScript)
## The Scenario
A shopping cart needs to **process payments** through pluggable strategies (Credit Card, PayPal, Bank Transfer). Each payment success or failure triggers a cascade of **notifications** to interested services (email, inventory, analytics) via the... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000801 |
Mathematics | - | hard | Let $\Phi$ and $\Psi$ denote the Euler totient and Dedekind‘s totient respectively. Determine all $n$ such that $\Phi(n)$ divides $n +\Psi (n)$. | [
"# Finding All $n$ with $\\Phi(n)\\mid n+\\Psi(n)$",
"## Setup and Notation",
"For $n=\\prod p_i^{a_i}$:\n$$\\Phi(n)=\\prod p_i^{a_i-1}(p_i-1),\\qquad \\Psi(n)=\\prod p_i^{a_i-1}(p_i+1)=n\\prod_{p\\mid n}\\!\\left(1+\\tfrac1p\\right).$$",
"I write $n=2^a\\cdot m$ with $m$ odd and analyze by the number of dist... | # Finding All $n$ with $\Phi(n)\mid n+\Psi(n)$
## Setup and Notation
For $n=\prod p_i^{a_i}$:
$$\Phi(n)=\prod p_i^{a_i-1}(p_i-1),\qquad \Psi(n)=\prod p_i^{a_i-1}(p_i+1)=n\prod_{p\mid n}\!\left(1+\tfrac1p\right).$$
I write $n=2^a\cdot m$ with $m$ odd and analyze by the number of distinct odd prime factors of $m$.
##... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000802 |
Mathematics | - | hard | Let \( f(x) \) be a function such that \( f(1) = 1 \) and \( f'(x) = \frac{1}{x^2 + f(x)^2} \) for \( x \geq 1 \). Calculate the upper bound \( M \) such that \( \lim_{x \to \infty} f(x) < M \). | [
"As stated, \\(M\\) is not unique: any number larger than the limit is an upper bound.",
"The natural comparison bound is:",
"Since \\(f'(x)>0\\), \\(f\\) is increasing, so \\(f(x)\\ge f(1)=1\\) for \\(x\\ge1\\).",
"Hence for \\(x>1\\),",
"\\[\n0<f'(x)=\\frac1{x^2+f(x)^2}<\\frac1{x^2+1}.\n\\]",
"Integrate... | As stated, \(M\) is not unique: any number larger than the limit is an upper bound. The natural comparison bound is:
Since \(f'(x)>0\), \(f\) is increasing, so \(f(x)\ge f(1)=1\) for \(x\ge1\). Hence for \(x>1\),
\[
0<f'(x)=\frac1{x^2+f(x)^2}<\frac1{x^2+1}.
\]
Integrate from \(1\) to \(b\):
\[
f(b)-1=\int_1^b f'(x)... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000803 |
Science | Physics | hard | 2. A uniform magnetic field $\boldsymbol{B}$ exists and it makes an angle $\phi$ with a particle's magnetic moment $\boldsymbol{\mu}$. Due to the torque by the magnetic field, the magnetic moment $\boldsymbol{\mu}$ rotates around the field $\boldsymbol{B}$, which is also known as Larmor precession. Determine the Larmo... | [
"# Larmor Precession Frequency",
"## Setting Up the Equation of Motion",
"The torque on the magnetic moment in a uniform field is",
"$$\\boldsymbol{\\tau} = \\boldsymbol{\\mu} \\times \\boldsymbol{B} = \\frac{d\\boldsymbol{L}}{dt}$$",
"Using the relation between magnetic moment and angular momentum, $\\bold... | # Larmor Precession Frequency
## Setting Up the Equation of Motion
The torque on the magnetic moment in a uniform field is
$$\boldsymbol{\tau} = \boldsymbol{\mu} \times \boldsymbol{B} = \frac{d\boldsymbol{L}}{dt}$$
Using the relation between magnetic moment and angular momentum, $\boldsymbol{\mu} = \gamma\,\boldsym... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000804 |
Mathematics | - | medium | In trapezoid $A B C D$ angles $A$ and $D$ are right, $A B=1, C D=4, A D=5$. On side $A D$ a point $M$ is taken such that $\angle C M D=$ $2 \angle B M A$.
In what ratio does point $M$ divide side $A D$? | [
"# Finding the Ratio in Which $M$ Divides $AD$",
"## Setting Up Coordinates",
"Since $\\angle A = \\angle D = 90°$ and $AB \\parallel CD$, I place:",
"| Point | Coordinates |\n|-------|------------|\n| $A$ | $(0,\\, 0)$ |\n| $D$ | $(0,\\, 5)$ |\n| $B$ | $(1,\\, 0)$ |\n| $C$ | $(4,\\, 5)$ |",
"Point $M$ lies... | # Finding the Ratio in Which $M$ Divides $AD$
## Setting Up Coordinates
Since $\angle A = \angle D = 90°$ and $AB \parallel CD$, I place:
| Point | Coordinates |
|-------|------------|
| $A$ | $(0,\, 0)$ |
| $D$ | $(0,\, 5)$ |
| $B$ | $(1,\, 0)$ |
| $C$ | $(4,\, 5)$ |
Point $M$ lies on segment $AD$, so $M = (0,\, m... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000805 |
Science | - | hard | What are the mechanistic pathways by which epigenetically inherited transposable element insertions alter three‑dimensional genome architecture in mammals, and how can multi‑omics data be integrated to predict phenotypic consequences across generations? | [
"# Epigenetically Inherited TE Insertions and 3D Genome Remodeling in Mammals",
"## 1.",
"Background: The Unique Status of Mammalian TE Epigenetic Inheritance",
"In mammals, the classical small-RNA-mediated epigenetic inheritance seen in plants and *C. elegans* is largely absent.",
"Instead, transgeneration... | # Epigenetically Inherited TE Insertions and 3D Genome Remodeling in Mammals
## 1. Background: The Unique Status of Mammalian TE Epigenetic Inheritance
In mammals, the classical small-RNA-mediated epigenetic inheritance seen in plants and *C. elegans* is largely absent. Instead, transgenerational TE-mediated epigenet... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000806 |
Programming | - | hard | Build a complete, single-page podcast homepage website using only HTML, CSS, and vanilla JavaScript (no frameworks). The design should be clean and typographic. Include: FAQ accordion with smooth expand/collapse; lazy-loading images using the loading='lazy' attribute; animated statistics/counters section; accessible AR... | [
"# Single-Page Podcast Homepage",
"Here's a complete, production-ready single-file solution.",
"Save it as `index.html` and open in any browser.",
"```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />... | # Single-Page Podcast Homepage
Here's a complete, production-ready single-file solution. Save it as `index.html` and open in any browser.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" con... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000807 |
Artificial Intelligence | Logic Puzzle | medium | A boat is floating in a small pool with a heavy rock sitting on the deck. If you throw the rock out of the boat so it sinks to the bottom of the pool, does the water level of the pool rise, fall, or stay the same? | [
"# The Water Level **Falls**",
"This is a classic Archimedes' principle puzzle, and the answer is a bit counterintuitive.",
"The key is to compare how much water the rock displaces in each scenario.",
"## While the rock is in the boat",
"The rock is part of the boat's load, so the boat sinks deeper to suppo... | # The Water Level **Falls**
This is a classic Archimedes' principle puzzle, and the answer is a bit counterintuitive. The key is to compare how much water the rock displaces in each scenario.
## While the rock is in the boat
The rock is part of the boat's load, so the boat sinks deeper to support its **weight**. The... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000808 |
Artificial Intelligence | Logic Puzzle | easy | A cyclist travels from their home to a cafe at 10 mph and returns home via the same route at 15 mph. What was their average speed for the entire round trip? | [
"## Average Speed for the Round Trip",
"A common mistake is to simply average 10 and 15 to get 12.5 mph, but that's **not** how average speed works.",
"Average speed is always:",
"$$\\text{Average Speed} = \\frac{\\text{Total Distance}}{\\text{Total Time}}$$",
"### Working It Out",
"Let the one-way distan... | ## Average Speed for the Round Trip
A common mistake is to simply average 10 and 15 to get 12.5 mph, but that's **not** how average speed works. Average speed is always:
$$\text{Average Speed} = \frac{\text{Total Distance}}{\text{Total Time}}$$
### Working It Out
Let the one-way distance be **d** miles.
| Leg | Sp... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000809 |
Artificial Intelligence | Logic Puzzle | easy | A designer jacket costs $750 more than a silk belt. If the total for both items is $1000, how much does the belt cost? | [
"## Solving for the Belt's Cost",
"Let the cost of the silk belt be **B**.",
"Since the jacket costs $750 more than the belt, the jacket costs **B + 750**.",
"Setting up the equation from the total:",
"$$B + (B + 750) = 1000$$",
"$$2B + 750 = 1000$$",
"$$2B = 250$$",
"$$B = 125$$",
"**The silk belt ... | ## Solving for the Belt's Cost
Let the cost of the silk belt be **B**.
Since the jacket costs $750 more than the belt, the jacket costs **B + 750**.
Setting up the equation from the total:
$$B + (B + 750) = 1000$$
$$2B + 750 = 1000$$
$$2B = 250$$
$$B = 125$$
**The silk belt costs $125.**
*Check:* Belt = $125, ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000810 |
Programming | Cpp | hard | Today professor Ka has given a string task to Oz and RK. He has given a string STR consisting only of characters '(' and ')' and asked them to convert the string STR into a closed one by adding parenthesis to start and/or end of string STR.
This means that they could add characters either only to the start of string ... | [
"# Solution",
"Looking at this problem, I need to find the minimum number of parentheses to add at the start and/or end to make the string a valid balanced parentheses string.",
"**Key Insight:**\n- We should only add `(` to the start (to fix unmatched `)` early in the string)\n- We should only add `)` to the e... | # Solution
Looking at this problem, I need to find the minimum number of parentheses to add at the start and/or end to make the string a valid balanced parentheses string.
**Key Insight:**
- We should only add `(` to the start (to fix unmatched `)` early in the string)
- We should only add `)` to the end (to fix unma... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000811 |
Artificial Intelligence | Logic Puzzle | easy | A cyclist bikes from her house to the cafe at a constant 20 mph. On the way back, she takes a different route of the exact same distance but travels it at a constant 40 mph. What was her average speed for the entire round trip? | [
"## Average Speed for the Round Trip",
"The key insight is that **average speed = total distance ÷ total time**, not the average of the two speeds.",
"Let the one-way distance be *d* miles.",
"| Leg | Speed | Time |\n|---|---|---|\n| House → Café | 20 mph | *d* / 20 |\n| Café → House | 40 mph | *d* / 40 |",
... | ## Average Speed for the Round Trip
The key insight is that **average speed = total distance ÷ total time**, not the average of the two speeds.
Let the one-way distance be *d* miles.
| Leg | Speed | Time |
|---|---|---|
| House → Café | 20 mph | *d* / 20 |
| Café → House | 40 mph | *d* / 40 |
**Total distance:** 2*... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000812 |
Programming | - | hard | You are tasked with implementing a program to solve the one-particle Schrödinger equation for a potential specified in a function. The specific example provided is for the harmonic oscillator in 3D. The program should take into account the boundary, orbital momentum, and number of integration points. The code snippet a... | [
"# Solving the One-Particle Schrödinger Equation (3D Harmonic Oscillator)",
"Here's a complete implementation of the `solve_schroedinger` function that numerically solves the radial Schrödinger equation using the finite difference method and matrix diagonalization:",
"```python\nimport numpy as np\nfrom scipy.l... | # Solving the One-Particle Schrödinger Equation (3D Harmonic Oscillator)
Here's a complete implementation of the `solve_schroedinger` function that numerically solves the radial Schrödinger equation using the finite difference method and matrix diagonalization:
```python
import numpy as np
from scipy.linalg import ei... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000813 |
Programming | - | hard | Write a PHP code to send an email notification to someone with the following conditions: - The email must include a subject line. - The email must include a greeting message with the recipient's name. - The email must include a body message. - The email must include a closing message. - The email must be sent using a s... | [
"# PHP Email Notification System",
"Below is a comprehensive, modular, and production-ready PHP email notification system using **PHPMailer** (the industry-standard library).",
"The code is structured into multiple classes for maintainability and scalability.",
"## Project Structure",
"```\n/\n├── composer.... | # PHP Email Notification System
Below is a comprehensive, modular, and production-ready PHP email notification system using **PHPMailer** (the industry-standard library). The code is structured into multiple classes for maintainability and scalability.
## Project Structure
```
/
├── composer.json
├── config/
│ └──... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000814 |
Programming | - | hard | problem
AOR Ika is a monster buster.
One day, as I was walking down the road, I met a sleeping monster.
AOR Ika, who has a strong fighting spirit, decides to hit the monster with a wake-up blow. However, the current attack power of AOR Ika is $ 0 $, and she cannot make a decent attack as it is.
AOR Ika-chan, who is ... | [
"Looking at this problem, I need to:\n1.",
"Determine how many times to play each song (k_i) based on the constraint (k-1)*R_i < T_i\n2.",
"Find the optimal ordering of songs to maximize the peak attack power\n3.",
"The peak is the maximum over all time points of the sum of active song contributions",
"For ... | Looking at this problem, I need to:
1. Determine how many times to play each song (k_i) based on the constraint (k-1)*R_i < T_i
2. Find the optimal ordering of songs to maximize the peak attack power
3. The peak is the maximum over all time points of the sum of active song contributions
For each song, the contribution... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000815 |
Programming | - | hard | Build a write-optimized endpoints with idempotency keys REST API for inventory items using Actix-web (Rust). Include: request body validation, pagination, database transactions, structured logging. Demonstrate proper layered architecture (handler → service → repository). | [
"# Inventory REST API — Actix-web (Rust)",
"## Project Structure",
"```\ninventory-api/\n├── Cargo.toml\n├── migrations/\n│ ├── 001_init.sql\n│ └── 002_idempotency.sql\n└── src/\n ├── main.rs\n ├── config.rs\n ├── state.rs\n ├── error.rs\n ├── logging.rs\n ├── pagination.rs\n ├── idempo... | # Inventory REST API — Actix-web (Rust)
## Project Structure
```
inventory-api/
├── Cargo.toml
├── migrations/
│ ├── 001_init.sql
│ └── 002_idempotency.sql
└── src/
├── main.rs
├── config.rs
├── state.rs
├── error.rs
├── logging.rs
├── pagination.rs
├── idempotency.rs
├── handlers/... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000816 |
Artificial Intelligence | Logic Puzzle | easy | A swimmer goes across a still lake at 4 mph, then swims back against a current of 2 mph. What is the swimmer's average speed for the round trip? | [
"## Setting Up the Problem",
"Average speed for a round trip is **total distance ÷ total time**, *not* the simple average of the two speeds.",
"Let the one-way distance across the lake be **D** miles.",
"| Leg | Speed | Time |\n|---|---|---|\n| Across (still water) | 4 mph | D / 4 hr |\n| Back (against curren... | ## Setting Up the Problem
Average speed for a round trip is **total distance ÷ total time**, *not* the simple average of the two speeds.
Let the one-way distance across the lake be **D** miles.
| Leg | Speed | Time |
|---|---|---|
| Across (still water) | 4 mph | D / 4 hr |
| Back (against current) | 2 mph | D / 2 h... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000817 |
Mathematics | - | medium | Determine the fundamental group \( \pi_1(X / \sim, x_0) \) for a point \( x_0 \in X / \sim \), where \( X \) is the subset of \( \mathbb{R}^3 \) defined as \( X=\left {x \in \mathbb{R}^3 \vert 1 \leq \lvert x \rvert \leq 2 \right } \) with boundary components \( S_1 = \left {x \in \mathbb{R}^3 \vert \lvert x \rvert = 1... | [
"# Fundamental Group of the Quotient Space $X/{\\sim}$",
"## Identifying the Quotient Space",
"The space $X = \\{x \\in \\mathbb{R}^3 : 1 \\le |x| \\le 2\\}$ is a **3-dimensional shell** (solid region between two concentric spheres).",
"Via the radial decomposition",
"$$x \\;\\longmapsto\\; \\bigl(\\tfrac{x... | # Fundamental Group of the Quotient Space $X/{\sim}$
## Identifying the Quotient Space
The space $X = \{x \in \mathbb{R}^3 : 1 \le |x| \le 2\}$ is a **3-dimensional shell** (solid region between two concentric spheres). Via the radial decomposition
$$x \;\longmapsto\; \bigl(\tfrac{x}{|x|},\; |x|\bigr),$$
it is home... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000818 |
Science | Corrosion Engineering | medium | Estimate the theoretical tendency for zinc to corrode (emf) when immersed in \( 10^{-6} \) to \( 10^{-1} \) M ZnCl\(_2\) solution at pH of 3. The corrosion cell is described as:\n\n\[ \text{Zn}(s) + 2\text{HCl}(aq) \rightarrow \text{ZnCl}_2(aq) + \text{H}_2(g) \] | [
"# Corrosion EMF of Zinc in Dilute ZnCl₂ at pH 3",
"## Identifying the Half-Reactions",
"| Electrode | Half-reaction | E° (V) |\n|-----------|--------------|--------|\n| **Anode** (oxidation) | Zn(s) → Zn²⁺(aq) + 2 e⁻ | −0.763 |\n| **Cathode** (reduction) | 2 H⁺(aq) + 2 e⁻ → H₂(g) | 0.000 |",
"**Overall cell ... | # Corrosion EMF of Zinc in Dilute ZnCl₂ at pH 3
## Identifying the Half-Reactions
| Electrode | Half-reaction | E° (V) |
|-----------|--------------|--------|
| **Anode** (oxidation) | Zn(s) → Zn²⁺(aq) + 2 e⁻ | −0.763 |
| **Cathode** (reduction) | 2 H⁺(aq) + 2 e⁻ → H₂(g) | 0.000 |
**Overall cell reaction:**
$$\text... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000819 |
Mathematics | Orca Math | hard | There are 10 bags on a truck, each containing 30 oranges. However, not all bags have the same quality of oranges. Four bags contain 10% rotten oranges each, three bags contain 20% rotten oranges, and the remaining three bags contain 5% rotten oranges. Out of the good oranges, 70 will be kept for making orange juice, 15... | [
"# Finding the Revenue from Selling Good Oranges",
"## Step 1: Count the Good Oranges in Each Group of Bags",
"| Bags | Rotten % | Rotten per bag | Good per bag | Total Good |\n|------|----------|---------------|-------------|------------|\n| 4 | 10% | 3 | 27 | 4 × 27 = **108** |\n| 3 | 20% | 6 | 24 | 3 × 24 = ... | # Finding the Revenue from Selling Good Oranges
## Step 1: Count the Good Oranges in Each Group of Bags
| Bags | Rotten % | Rotten per bag | Good per bag | Total Good |
|------|----------|---------------|-------------|------------|
| 4 | 10% | 3 | 27 | 4 × 27 = **108** |
| 3 | 20% | 6 | 24 | 3 × 24 = **72** |
| 3 | 5... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000820 |
Artificial Intelligence | Logic Puzzle | easy | I took my cat to the vet for a checkup, but then realized the cat was still sleeping on the sofa. I drove to the vet, waited for thirty minutes, and then went back home. How many cats are at the vet right now? | [
"**Zero.**",
"Your cat was never actually at the vet.",
"You *thought* you took it, but you realized it was still asleep on the sofa.",
"So you drove to the vet, waited thirty minutes (presumably confused or hoping the appointment would still be on the books), and drove home — all while your cat was napping o... | **Zero.**
Your cat was never actually at the vet. You *thought* you took it, but you realized it was still asleep on the sofa. So you drove to the vet, waited thirty minutes (presumably confused or hoping the appointment would still be on the books), and drove home — all while your cat was napping on the couch the ent... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000821 |
Programming | - | hard | Implement a Swift function that solves: Given an array, find the kth largest element without fully sorting the array. Provide the solution and trace through it on at least two example inputs. | [
"# Finding the Kth Largest Element with QuickSelect (Swift)",
"## The Algorithm: QuickSelect",
"QuickSelect is a partition-based algorithm (a cousin of QuickSort) that finds the kth smallest/largest element in **average O(n)** time by repeatedly partitioning and discarding the half that doesn't contain the answ... | # Finding the Kth Largest Element with QuickSelect (Swift)
## The Algorithm: QuickSelect
QuickSelect is a partition-based algorithm (a cousin of QuickSort) that finds the kth smallest/largest element in **average O(n)** time by repeatedly partitioning and discarding the half that doesn't contain the answer. Instead o... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000822 |
Programming | - | hard | Implement a production-ready REST API for managing orders with Hono (TypeScript). Include: cursor-based pagination, request body validation, search / full-text query, pagination, structured logging. Include integration tests using a test database. | [
"# Orders REST API — Hono + TypeScript",
"**Stack:** Hono 4, Zod (validation), Pino (structured JSON logging), better-sqlite3 with FTS5 (full-text search), Vitest (integration tests against a throwaway in-memory database).",
"The DB access is isolated behind a repository class, so swapping in Postgres later onl... | # Orders REST API — Hono + TypeScript
**Stack:** Hono 4, Zod (validation), Pino (structured JSON logging), better-sqlite3 with FTS5 (full-text search), Vitest (integration tests against a throwaway in-memory database). The DB access is isolated behind a repository class, so swapping in Postgres later only means rewrit... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000823 |
Mathematics | - | hard | Find all values of the parameter \( a \) for which the inequality
\[ a9^{x} + 4(a-1)3^{x} + a > 1 \]
is satisfied for all real values of \( x \). | [
"Let",
"\\[\nF_a(x)=a9^x+4(a-1)3^x+a.\n\\]",
"We need",
"\\[\nF_a(x)>1 \\qquad \\text{for all } x\\in\\mathbb R.\n\\]",
"### 1.",
"Necessary condition",
"As \\(x\\to -\\infty\\),",
"\\[\n9^x\\to 0,\\qquad 3^x\\to 0,\n\\]",
"so",
"\\[\n\\lim_{x\\to -\\infty} F_a(x)=a.\n\\]",
"If \\(a<1\\), then f... | Let
\[
F_a(x)=a9^x+4(a-1)3^x+a.
\]
We need
\[
F_a(x)>1 \qquad \text{for all } x\in\mathbb R.
\]
### 1. Necessary condition
As \(x\to -\infty\),
\[
9^x\to 0,\qquad 3^x\to 0,
\]
so
\[
\lim_{x\to -\infty} F_a(x)=a.
\]
If \(a<1\), then for sufficiently negative \(x\), we would have
\[
F_a(x)<1,
\]
which contradi... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000824 |
Programming | Python | hard | There are N islands and M bridges.
The i-th bridge connects the A_i-th and B_i-th islands bidirectionally.
Initially, we can travel between any two islands using some of these bridges.
However, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to the ... | [
"Looking at this problem, I need to find the number of disconnected pairs after each bridge collapse.",
"Since removing edges is hard with DSU, I'll **reverse the process**: start with no bridges (all collapsed) and add bridges back in reverse order.",
"**Key Insight:** \n- Total pairs = N*(N-1)/2\n- Inconvenie... | Looking at this problem, I need to find the number of disconnected pairs after each bridge collapse. Since removing edges is hard with DSU, I'll **reverse the process**: start with no bridges (all collapsed) and add bridges back in reverse order.
**Key Insight:**
- Total pairs = N*(N-1)/2
- Inconvenience = total_pair... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000825 |
Programming | Cpp | hard | problem
There are many $ N $ colored balls of different weights in the queue. The queue is in ascending order from the beginning: $ 1,2,3, \dots, N-1, N, 1,2,3, \dots, N-1, N, 1,2,3, \dots $ The balls are lined up, followed by the balls of color $ N $, followed by the balls of color $ 1 $. Balls of the same color weig... | [
"Looking at this problem, I need to:",
"1.",
"Determine how many groups are formed: The queue repeats 1,2,...,N.",
"Taking M balls repeatedly, I stop when each color appears the same number of times.",
"This requires total balls taken to be a multiple of N.",
"With G groups, M·G ≡ 0 (mod N), so G = N/gcd(... | Looking at this problem, I need to:
1. Determine how many groups are formed: The queue repeats 1,2,...,N. Taking M balls repeatedly, I stop when each color appears the same number of times. This requires total balls taken to be a multiple of N. With G groups, M·G ≡ 0 (mod N), so G = N/gcd(M,N).
2. Find the colors in ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000826 |
Artificial Intelligence | Logic Puzzle | easy | A professional ergonomic chair costs $215 more than the matching desk lamp. How much does the desk lamp cost? | [
"## Not Enough Information",
"The problem gives us one relationship:",
"**Chair = Lamp + $215**",
"But that's a single equation with **two unknowns**, so there are infinitely many solutions.",
"For example:",
"| Desk Lamp | Chair |\n|-----------|-------|\n| $50 | $265 |\n| $100 | $315 |\n| $200 | $415 |\n... | ## Not Enough Information
The problem gives us one relationship:
**Chair = Lamp + $215**
But that's a single equation with **two unknowns**, so there are infinitely many solutions. For example:
| Desk Lamp | Chair |
|-----------|-------|
| $50 | $265 |
| $100 | $315 |
| $200 | $415 |
| … | … |
All of these satisfy... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000827 |
Science | - | hard | Design a multi‑scale molecular dynamics–quantum mechanics hybrid scheme to simulate enzymatic catalysis in a metalloenzyme, specifying the partitioning criteria, coupling algorithm, and how to treat electronic polarization effects while preserving detailed balance? | [
"# Multi-Scale QM/MM Hybrid Scheme for Metalloenzyme Catalysis",
"## 1.",
"Architecture Overview",
"The scheme employs three concentric layers around the catalytic centre, each treated with a different level of theory, connected by a hierarchical coupling protocol:",
"| Layer | Radius / Content | Level of T... | # Multi-Scale QM/MM Hybrid Scheme for Metalloenzyme Catalysis
## 1. Architecture Overview
The scheme employs three concentric layers around the catalytic centre, each treated with a different level of theory, connected by a hierarchical coupling protocol:
| Layer | Radius / Content | Level of Theory |
|---|---|---|
... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000828 |
Programming | - | hard | Using Python, create a function that takes in an integer n and returns a list containing the first n prime numbers. The function should have a time complexity of O(n^2) or better and should not use any external libraries or functions for prime number generation. Additionally, the function should not use any iterative... | [
"# First N Primes Using Miller-Rabin Primality Test",
"```python\ndef _mod_pow(base, exp, modulus):\n \"\"\"\n Compute (base ^ exp) % modulus using repeated squaring.",
"Time complexity: O(log(exp)) multiplications.\n \"\"\"\n if modulus == 1:\n return 0\n result = 1\n base %= modulus\n... | # First N Primes Using Miller-Rabin Primality Test
```python
def _mod_pow(base, exp, modulus):
"""
Compute (base ^ exp) % modulus using repeated squaring.
Time complexity: O(log(exp)) multiplications.
"""
if modulus == 1:
return 0
result = 1
base %= modulus
while exp > 0:
... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000829 |
Mathematics | Synthetic Math | easy | If \(a\) and \(b\) are non-zero real numbers such that \(a^2 + b^2 = 18ab\), find the value of \(\left|\frac{a+b}{a-b}\right|\). | [
"# Finding $\\left|\\dfrac{a+b}{a-b}\\right|$",
"## Setting Up the Key Expressions",
"I need to evaluate $\\left(\\dfrac{a+b}{a-b}\\right)^2$, which equals:",
"$$\\frac{(a+b)^2}{(a-b)^2} = \\frac{a^2 + 2ab + b^2}{a^2 - 2ab + b^2}$$",
"## Substituting the Given Condition",
"Since $a^2 + b^2 = 18ab$, I subs... | # Finding $\left|\dfrac{a+b}{a-b}\right|$
## Setting Up the Key Expressions
I need to evaluate $\left(\dfrac{a+b}{a-b}\right)^2$, which equals:
$$\frac{(a+b)^2}{(a-b)^2} = \frac{a^2 + 2ab + b^2}{a^2 - 2ab + b^2}$$
## Substituting the Given Condition
Since $a^2 + b^2 = 18ab$, I substitute:
**Numerator:**
$$(a+b)^2... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000830 |
Science | - | hard | What quantum mechanical criteria and orbital symmetry considerations dictate the feasibility of a concerted pericyclic cascade converting a polyunsaturated fatty acid into a cyclized terpenoid scaffold, and how can density functional theory accurately capture the associated transition state energetics? | [
"# Pericyclic Cascade Conversion of Polyunsaturated Fatty Acids to Cyclized Terpenoid Scaffolds: Orbital Symmetry, Feasibility Criteria, and DFT Treatment",
"## 1.",
"The Woodward–Hoffmann / Orbital-Symmetry Framework",
"The feasibility of any individual step in the cascade is governed by the conservation of ... | # Pericyclic Cascade Conversion of Polyunsaturated Fatty Acids to Cyclized Terpenoid Scaffolds: Orbital Symmetry, Feasibility Criteria, and DFT Treatment
## 1. The Woodward–Hoffmann / Orbital-Symmetry Framework
The feasibility of any individual step in the cascade is governed by the conservation of orbital symmetry (... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000831 |
Science | - | hard | How does the interplay between electron-phonon coupling and topological band inversion manifest in the temperature-dependent anomalous Hall conductivity of a three-dimensional Weyl semimetal under high magnetic fields? | [
"# Electron-Phonon Coupling, Band Inversion, and the Anomalous Hall Conductivity in a 3D Weyl Semimetal",
"This sits at a frontier where several normally treated separately become entangled, so let me walk through the physics layer by layer and then describe how the pieces couple.",
"---",
"## 1.",
"The Zer... | # Electron-Phonon Coupling, Band Inversion, and the Anomalous Hall Conductivity in a 3D Weyl Semimetal
This sits at a frontier where several normally treated separately become entangled, so let me walk through the physics layer by layer and then describe how the pieces couple.
---
## 1. The Zero-Temperature Baseline... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000832 |
Programming | Cpp | hard | Takahashi became a pastry chef and opened a shop La Confiserie d'ABC to celebrate AtCoder Beginner Contest 100.
The shop sells N kinds of cakes.
Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i.
Th... | [
"Looking at this problem, I need to maximize |sum_x| + |sum_y| + |sum_z| over all choices of M cakes.",
"**Key Insight:** The identity |a| + |b| + |c| = max over (s₁,s₂,s₃)∈{-1,1}³ of (s₁a + s₂b + s₃c) lets me decompose the problem.",
"The maximum of |Σx| + |Σy| + |Σz| over all sets S of M cakes equals:\n- max ... | Looking at this problem, I need to maximize |sum_x| + |sum_y| + |sum_z| over all choices of M cakes.
**Key Insight:** The identity |a| + |b| + |c| = max over (s₁,s₂,s₃)∈{-1,1}³ of (s₁a + s₂b + s₃c) lets me decompose the problem.
The maximum of |Σx| + |Σy| + |Σz| over all sets S of M cakes equals:
- max over 8 sign co... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000833 |
Artificial Intelligence | Logic Puzzle | easy | If I had 15 vintage stamps and gave away 6 of them, how many stamps would I have right now? | [
"You would have **9** stamps left.",
"(15 − 6 = 9)"
] | You would have **9** stamps left.
(15 − 6 = 9) | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000834 |
Programming | - | medium | You have initially a string of N characters, denoted by A1,A2...AN. You have to print the size of the largest subsequence of string A such that all the characters in that subsequence are distinct ie. no two characters in that subsequence should be same.
A subsequence of string A is a sequence that can be derived from A... | [
"## Solution",
"The key insight is that the largest subsequence with all distinct characters is simply the **count of distinct characters** in the string.",
"**Why?** Since a subsequence preserves order but allows skipping elements, we can always select exactly one occurrence of each distinct character (in the ... | ## Solution
The key insight is that the largest subsequence with all distinct characters is simply the **count of distinct characters** in the string.
**Why?** Since a subsequence preserves order but allows skipping elements, we can always select exactly one occurrence of each distinct character (in the order they ap... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000835 |
Programming | Python | hard | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right.
Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below.
You are given an integer K that is less than or equal to 10, and K non-intersecting segments [L_1, R_1], [L_2, R_2... | [
"Looking at this problem, I need to count the number of ways Tak can go from Cell 1 to Cell N, where from Cell i he can move to Cell i+d for any d in S (the union of K non-intersecting segments).",
"**Key Insight:** This is a DP problem where `dp[i]` = number of ways to reach Cell i.",
"The transition is:\n```\... | Looking at this problem, I need to count the number of ways Tak can go from Cell 1 to Cell N, where from Cell i he can move to Cell i+d for any d in S (the union of K non-intersecting segments).
**Key Insight:** This is a DP problem where `dp[i]` = number of ways to reach Cell i. The transition is:
```
dp[i] = sum of ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000836 |
Science | - | hard | What are the mechanistic pathways by which allosteric regulation of multi-domain enzymes integrates post-translational modifications and metabolite channeling to achieve substrate specificity and catalytic efficiency in compartmentalized cellular microenvironments? | [
"# Allosteric Integration of PTMs, Metabolite Channeling, and Compartmental Context in Multi-Domain Enzymes",
"This question sits at a convergence point in modern enzymology where structural biology, chemical kinetics, and systems-level cell biology must be considered simultaneously.",
"No single mechanism suff... | # Allosteric Integration of PTMs, Metabolite Channeling, and Compartmental Context in Multi-Domain Enzymes
This question sits at a convergence point in modern enzymology where structural biology, chemical kinetics, and systems-level cell biology must be considered simultaneously. No single mechanism suffices; the func... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000837 |
Mathematics | - | medium | Find all pairs of relatively prime numbers ($x, y$) such that $x^2(x + y)$ is divisible by $y^2(y - x)^2$.
. | [
"# Finding Relatively Prime Pairs $(x,y)$ where $y^2(y-x)^2 \\mid x^2(x+y)$",
"## Setting Up Key Divisibility Constraints",
"Since $\\gcd(x,y)=1$, I have $\\gcd(y^2,\\,x^2)=1$.",
"**Step 1: Extract the $y^2$ constraint.**",
"Since $y^2 \\mid y^2(y-x)^2 \\mid x^2(x+y)$, it follows that:\n$$y^2 \\mid x^2(x+y)... | # Finding Relatively Prime Pairs $(x,y)$ where $y^2(y-x)^2 \mid x^2(x+y)$
## Setting Up Key Divisibility Constraints
Since $\gcd(x,y)=1$, I have $\gcd(y^2,\,x^2)=1$.
**Step 1: Extract the $y^2$ constraint.**
Since $y^2 \mid y^2(y-x)^2 \mid x^2(x+y)$, it follows that:
$$y^2 \mid x^2(x+y)$$
Because $\gcd(y^2,x^2)=1$... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000838 |
Artificial Intelligence | Logic Puzzle | easy | I'm driving my car through the automatic carwash, but I just realized I left my phone on the kitchen table. After the car finishes the wash and I drive it out, where is my phone? | [
"Your phone is still on the kitchen table.",
"The car wash only cleans the car — your phone wasn't in the car, so it's unaffected by the whole process.",
"It's exactly where you left it."
] | Your phone is still on the kitchen table. The car wash only cleans the car — your phone wasn't in the car, so it's unaffected by the whole process. It's exactly where you left it. | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000839 |
Programming | - | hard | You are given $n$ strings $s_1, s_2, \ldots, s_n$ consisting of lowercase Latin letters.
In one operation you can remove a character from a string $s_i$ and insert it to an arbitrary position in a string $s_j$ ($j$ may be equal to $i$). You may perform this operation any number of times. Is it possible to make all $n$... | [
"```python\nimport sys",
"def solve():\n data = sys.stdin.read().split()\n if not data:\n return",
"t = int(data[0])\n idx = 1\n ans = []",
"for _ in range(t):\n n = int(data[idx])\n idx += 1",
"total_len = 0\n cnt = [0] * 26",
"for _ in range(n):\n s = d... | ```python
import sys
def solve():
data = sys.stdin.read().split()
if not data:
return
t = int(data[0])
idx = 1
ans = []
for _ in range(t):
n = int(data[idx])
idx += 1
total_len = 0
cnt = [0] * 26
for _ in range(n):
s = data[idx]
... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000840 |
Programming | - | hard | When he's not training for IOI, Little Alawn enjoys playing with puzzles of various types to stimulate his brain. Today, he's playing with a puzzle that consists of a $2 \times n$ grid where each row is a permutation of the numbers $1,2,3,\ldots,n$.
The goal of Little Alawn's puzzle is to make sure no numbers on the s... | [
"# Solution",
"## Key Insight",
"Let me define a permutation $f$ on $\\{1, \\ldots, n\\}$: for each position $i$, $f(i)$ = the position of value $a_i$ (from row 1) in row 2.",
"**A set $S$ of columns to swap yields a valid solved configuration if and only if $S$ is closed under $f$:** $i \\in S \\implies f(i)... | # Solution
## Key Insight
Let me define a permutation $f$ on $\{1, \ldots, n\}$: for each position $i$, $f(i)$ = the position of value $a_i$ (from row 1) in row 2.
**A set $S$ of columns to swap yields a valid solved configuration if and only if $S$ is closed under $f$:** $i \in S \implies f(i) \in S$.
**Why?** Aft... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000841 |
Programming | Python | hard | Dima overslept the alarm clock, which was supposed to raise him to school.
Dima wonders if he will have time to come to the first lesson. To do this, he needs to know the minimum time it will take him to get from home to school.
The city where Dima lives is a rectangular field of n × m size. Each cell (i, j) on this ... | [
"Looking at this problem, I need to find the minimum time from (1,1) to (n,m) with two types of movement: walking (cost w per step) and portal teleportation (cost a[p] + a[q] between any two portals).",
"**Key Insight:** The teleport cost `a[p] + a[q]` **separates** into a part depending only on `p` and a part de... | Looking at this problem, I need to find the minimum time from (1,1) to (n,m) with two types of movement: walking (cost w per step) and portal teleportation (cost a[p] + a[q] between any two portals).
**Key Insight:** The teleport cost `a[p] + a[q]` **separates** into a part depending only on `p` and a part depending o... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000842 |
Mathematics | Synthetic Math | hard | Consider $\triangle ABC$ with $\angle A = 60^\circ$, $\angle B = 50^\circ$, and $\angle C = 70^\circ$. $ABCDE$ is a pentagon where each vertex lies on the midpoint of each side of $\triangle ABC$, such that $D$ is on $\overline{AB}$, $E$ is on $\overline{BC}$, and each side of the pentagon is tangent to a common circle... | [
"Looking at this problem, I need to find $\\angle ADE$ where $D$ is the midpoint of $\\overline{AB}$ and $E$ is the midpoint of $\\overline{BC}$ in $\\triangle ABC$.",
"## Setting Up the Key Geometric Relationships",
"**Identifying the vectors from $D$:**",
"Since $D$ is the midpoint of $\\overline{AB}$:\n$$\... | Looking at this problem, I need to find $\angle ADE$ where $D$ is the midpoint of $\overline{AB}$ and $E$ is the midpoint of $\overline{BC}$ in $\triangle ABC$.
## Setting Up the Key Geometric Relationships
**Identifying the vectors from $D$:**
Since $D$ is the midpoint of $\overline{AB}$:
$$\vec{DA} = \frac{1}{2}\v... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000843 |
Science | - | hard | In a coupled ocean-atmosphere general circulation model, how does incorporating stochastic parameterizations of mesoscale eddies alter the projected equilibrium climate sensitivity and regional precipitation extremes under a 2 °C warming scenario? | [
"# Stochastic Mesoscale-Eddy Parameterization and Its Imprint on ECS and Precipitation Extremes",
"This sits at a genuinely active intersection of dynamical-systems theory, ocean modelling, and climate projection, and the answer is multi-layered.",
"I'll walk through the relevant physics, the pathways by which ... | # Stochastic Mesoscale-Eddy Parameterization and Its Imprint on ECS and Precipitation Extremes
This sits at a genuinely active intersection of dynamical-systems theory, ocean modelling, and climate projection, and the answer is multi-layered. I'll walk through the relevant physics, the pathways by which a stochastic e... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000844 |
Programming | - | medium | You are tasked with creating a program that scrapes data from a website and extracts specific information using regular expressions. The program should take a URL as input and retrieve the HTML content from the webpage. Then, it should use regular expressions to extract specific data from the HTML, such as email addres... | [
"# Web Scraping with Regular Expressions",
"Here's the implementation of the `scrape_data` function that fetches HTML content from a URL and extracts data using regular expressions:",
"```python\nimport re\nimport requests\nfrom typing import List",
"def scrape_data(url: str, pattern: str) -> List[str]:\n ... | # Web Scraping with Regular Expressions
Here's the implementation of the `scrape_data` function that fetches HTML content from a URL and extracts data using regular expressions:
```python
import re
import requests
from typing import List
def scrape_data(url: str, pattern: str) -> List[str]:
"""
Scrape data f... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000845 |
Programming | - | hard | Build a complete, single-page electronics store website using only HTML, CSS, and vanilla JavaScript (no frameworks). The design should be minimalist and modern. Include: lazy-loading images using the loading='lazy' attribute; Google Fonts and Font Awesome icons integration; focus-visible styles for keyboard navigation... | [
"# Voltix — Single-Page Electronics Store",
"A complete, self-contained website in **one HTML file**.",
"Save it as `index.html` and open it in a browser — no build tools, no frameworks.",
"```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <!-- ===========================================================... | # Voltix — Single-Page Electronics Store
A complete, self-contained website in **one HTML file**. Save it as `index.html` and open it in a browser — no build tools, no frameworks.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<!-- ============================================================
META & DOCUMENT... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000846 |
Mathematics | - | hard | Find all polynomials $P$ with complex coefficients such that:
$$(P(x))^2 = x^2P(x) + xP(x) - 1$$ | [
"# Finding Polynomials $P$ Satisfying $P(x)^2 = x^2 P(x) + xP(x) - 1$",
"## Setting Up the Degree Argument",
"I rearrange the equation as:\n$$P(x)^2 - (x^2+x)\\,P(x) + 1 = 0$$",
"**If $P$ is constant** ($P(x) = c$): Substituting gives $c^2 = cx^2 + cx - 1$.",
"The $x^2$-coefficient forces $c=0$, but then $0... | # Finding Polynomials $P$ Satisfying $P(x)^2 = x^2 P(x) + xP(x) - 1$
## Setting Up the Degree Argument
I rearrange the equation as:
$$P(x)^2 - (x^2+x)\,P(x) + 1 = 0$$
**If $P$ is constant** ($P(x) = c$): Substituting gives $c^2 = cx^2 + cx - 1$. The $x^2$-coefficient forces $c=0$, but then $0=-1$, a contradiction. N... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000847 |
Programming | - | medium | You are given a string s=s_1s_2... s_n of length n, which only contains digits 1, 2, ..., 9.
A substring s[l ... r] of s is a string s_l s_{l + 1} s_{l + 2} … s_r. A substring s[l ... r] of s is called even if the number represented by it is even.
Find the number of even substrings of s. Note, that even if some subs... | [
"# Counting Even Substrings",
"## Key Insight",
"A number is even **if and only if its last digit is even** (2, 4, 6, or 8).",
"For a substring `s[l...r]`, the last digit is `s[r]`.",
"So the substring is even **exactly when `s[r]` is an even digit**, regardless of what comes before it.",
"For each positi... | # Counting Even Substrings
## Key Insight
A number is even **if and only if its last digit is even** (2, 4, 6, or 8).
For a substring `s[l...r]`, the last digit is `s[r]`. So the substring is even **exactly when `s[r]` is an even digit**, regardless of what comes before it.
For each position `r` (1-indexed) where `... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000848 |
Programming | - | hard | Refactor the following JavaScript code smell: a JavaScript test suite with 19 tests that all share a complex mutable setup object, causing test-order dependency and silent failures. Apply extract classes/modules to separate concerns and apply the Single Responsibility Principle. Show a clear before-and-after and explai... | [
"# Refactoring a Shared Mutable Fixture: Extract & SRP",
"## The Code Smell (Before)",
"A single test file where all 19 tests mutate one global `ctx` object.",
"Tests pass in sequence but fail in isolation.",
"Reordering or running a subset silently breaks others.",
"```javascript\n// orders.test.js (BEF... | # Refactoring a Shared Mutable Fixture: Extract & SRP
## The Code Smell (Before)
A single test file where all 19 tests mutate one global `ctx` object. Tests pass in sequence but fail in isolation. Reordering or running a subset silently breaks others.
```javascript
// orders.test.js (BEFORE) — 19 tests, 1 shared m... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000849 |
Programming | - | medium | Create a div in HTML with a background color of 'blue' that is positioned at the center of the page and has a width of 500 pixels and a height of 300 pixels. Additionally, the div should have a border radius of 10 pixels and a text color of 'white'. However, you are not allowed to use any CSS properties or inline style... | [
"# Centered Blue Div Using Only JavaScript",
"Here's a complete HTML file where **all styling is applied exclusively via JavaScript** — no `<style>` tags, no `style` attributes in markup, no external CSS:",
"```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"vie... | # Centered Blue Div Using Only JavaScript
Here's a complete HTML file where **all styling is applied exclusively via JavaScript** — no `<style>` tags, no `style` attributes in markup, no external CSS:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=d... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000850 |
Science | Physical Chemistry | medium | A hydrogen electrode placed in a buffer solution of CH\(_3\)COONa and CH\(_3\)COOH in the ratio’s x:y and y:x has electrode potential values \(E_1\) and \(E_2\) volts, respectively, at 25°C. The pK\(_a\) value of acetic acid is \n(a) \((E_1 + E_2)/0.118\) \n(b) \((E_2 - E_1)/0.118\) \n(c) \((E_1 - E_2)/0.118\) \n(d... | [
"# Finding pKₐ from Hydrogen Electrode Potentials",
"## Setting Up the Electrode Potentials",
"For a hydrogen electrode (25 °C, P_H₂ = 1 atm), the potential is:",
"$$E = 0.0591 \\times \\text{pH}$$",
"For a CH₃COONa/CH₃COOH buffer, the Henderson–Hasselbalch equation gives:",
"$$\\text{pH} = \\text{p}K_a +... | # Finding pKₐ from Hydrogen Electrode Potentials
## Setting Up the Electrode Potentials
For a hydrogen electrode (25 °C, P_H₂ = 1 atm), the potential is:
$$E = 0.0591 \times \text{pH}$$
For a CH₃COONa/CH₃COOH buffer, the Henderson–Hasselbalch equation gives:
$$\text{pH} = \text{p}K_a + \log\frac{[\text{CH}_3\text{... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000851 |
Mathematics | - | easy | In a club with 20 members (10 boys and 10 girls), how many ways can we choose a president and a vice president if they must be of the same gender? | [
"## Choosing President and Vice President (Same Gender)",
"Since the president and vice president are **distinct roles**, order matters.",
"I'll consider the two valid cases:",
"### Case 1: Both are Boys\n| Role | Choices |\n|------|---------|\n| President | 10 boys |\n| Vice President | 9 remaining boys |",
... | ## Choosing President and Vice President (Same Gender)
Since the president and vice president are **distinct roles**, order matters. I'll consider the two valid cases:
### Case 1: Both are Boys
| Role | Choices |
|------|---------|
| President | 10 boys |
| Vice President | 9 remaining boys |
$$10 \times 9 = 90$$
#... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000852 |
Programming | - | hard | Use dynamic programming in C# to solve the unbounded knapsack problem with 4 item types and capacity 63. Analyze time and space complexity, then show a space-optimized version. | [
"# Unbounded Knapsack in C# — Dynamic Programming",
"## Problem Recap",
"You have **4 item types**, each available in **unlimited quantity**, and a knapsack of **capacity 63**.",
"Pick (any number of) copies of items to maximise total value without exceeding capacity.",
"---",
"## 1.",
"Full Solution wi... | # Unbounded Knapsack in C# — Dynamic Programming
## Problem Recap
You have **4 item types**, each available in **unlimited quantity**, and a knapsack of **capacity 63**. Pick (any number of) copies of items to maximise total value without exceeding capacity.
---
## 1. Full Solution with Both DP Variants
```csharp
... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000853 |
Science | - | hard | How does stochastic spatial heterogeneity in reaction–diffusion models of tumor microenvironments influence the emergence of resistant phenotypes under adaptive therapy, and can optimal control theory predict robust treatment schedules? | [
"# Stochastic Spatial Heterogeneity, Adaptive Therapy, and Optimal Control in Tumor Microenvironments",
"This question sits at the confluence of mathematical biology, stochastic analysis, and control theory, and it touches on several genuinely open research fronts.",
"I'll unpack each layer, then show how they ... | # Stochastic Spatial Heterogeneity, Adaptive Therapy, and Optimal Control in Tumor Microenvironments
This question sits at the confluence of mathematical biology, stochastic analysis, and control theory, and it touches on several genuinely open research fronts. I'll unpack each layer, then show how they interact, and ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000854 |
Science | - | hard | In deep continental crustal fluids, how do pressure‑induced changes in mineral lattice defects modulate the redox speciation and transport kinetics of uranium and lead, and what implications does this have for long‑term sequestration modeling? | [
"# Pressure-Modulated Lattice Defects, U/Pb Redox and Transport, and Sequestration Modeling",
"This question sits at the intersection of mineral physics, redox geochemistry, and nuclear-waste hydrology, and it is still an active frontier where many parameters are only loosely constrained.",
"I'll walk through t... | # Pressure-Modulated Lattice Defects, U/Pb Redox and Transport, and Sequestration Modeling
This question sits at the intersection of mineral physics, redox geochemistry, and nuclear-waste hydrology, and it is still an active frontier where many parameters are only loosely constrained. I'll walk through the mechanism c... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000855 |
Mathematics | - | hard | Given two sets of positive integers ${a_{1},a_{2},...,a_{n}}$ and ${b_{1},b_{2},...,b_{k}}$ with the same sum of elements, and that sum is less than $nk$. Let $S$ be the sum of all elements in both sets. Find the maximum number of elements that can be omitted from both sets such that the equality $a_{1}+a_{2}+...+a_{n}... | [
"# Maximum Elements Omitted While Preserving Equal Sums",
"## Setting Up the Problem",
"With $n = 5$, $k = 4$, and $S = 30$:",
"- **Set A** (5 positive integers): $a_1 + a_2 + a_3 + a_4 + a_5 = 15$\n- **Set B** (4 positive integers): $b_1 + b_2 + b_3 + b_4 = 15$\n- Constraint check: $15 < nk = 5 \\times 4 = 2... | # Maximum Elements Omitted While Preserving Equal Sums
## Setting Up the Problem
With $n = 5$, $k = 4$, and $S = 30$:
- **Set A** (5 positive integers): $a_1 + a_2 + a_3 + a_4 + a_5 = 15$
- **Set B** (4 positive integers): $b_1 + b_2 + b_3 + b_4 = 15$
- Constraint check: $15 < nk = 5 \times 4 = 20$ ✓
We want to **m... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000856 |
Programming | - | hard | Implement a secrets scanner that searches a directory for accidentally committed API keys or tokens as a standalone CLI in TypeScript. Support --dry-run and --verbose flags. Include argument validation and helpful error messages. | [
"# Secrets Scanner CLI",
"A standalone TypeScript CLI that recursively scans a directory tree for accidentally committed secrets (API keys, tokens, private keys, etc.).",
"## Project Structure",
"```\nsecrets-scanner/\n├── src/\n│ ├── index.ts # Entry point, arg parsing, orchestration\n│ ├── patter... | # Secrets Scanner CLI
A standalone TypeScript CLI that recursively scans a directory tree for accidentally committed secrets (API keys, tokens, private keys, etc.).
## Project Structure
```
secrets-scanner/
├── src/
│ ├── index.ts # Entry point, arg parsing, orchestration
│ ├── patterns.ts # Detection... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000857 |
Programming | - | medium | What is the solution to evaluate a mathematical expression given as a string in Python? | [
"# Evaluating a Mathematical Expression from a String in Python",
"There are several approaches, ranging from quick-and-dirty to secure.",
"## 1. `eval()` — Simple but Dangerous",
"```python\nexpression = \"2 + 3 * 4 ** 2\"\nresult = eval(expression) # 50\nprint(result)\n```",
"> ⚠️ **Warning:** `eval()` e... | # Evaluating a Mathematical Expression from a String in Python
There are several approaches, ranging from quick-and-dirty to secure.
## 1. `eval()` — Simple but Dangerous
```python
expression = "2 + 3 * 4 ** 2"
result = eval(expression) # 50
print(result)
```
> ⚠️ **Warning:** `eval()` executes *arbitrary* Python ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000858 |
Mathematics | - | hard | I.v.
In the multiplication example written on the board, the hooligan Petya changed two digits. It became 4$\cdot$5$\cdot$4$\cdot$5$\cdot$4 = 2247. Restore the original example.
# | [
"# Restoring the Original Multiplication",
"## Setting Up the Problem",
"The scribbled expression is:",
"$$4 \\cdot 5 \\cdot 4 \\cdot 5 \\cdot 4 = 2247$$",
"Petya altered **exactly two digits** among the five multipliers and the four-digit result.",
"I need to find the correct original equation.",
"## S... | # Restoring the Original Multiplication
## Setting Up the Problem
The scribbled expression is:
$$4 \cdot 5 \cdot 4 \cdot 5 \cdot 4 = 2247$$
Petya altered **exactly two digits** among the five multipliers and the four-digit result. I need to find the correct original equation.
## Searching for the Right Fix
The le... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000859 |
Mathematics | Aops Forum | hard | Let the angle bisectors of $\angle BAC,$ $\angle CBA,$ and $\angle ACB$ meets the circumcircle of $\triangle ABC$ at the points $M,N,$ and $K,$ respectively. Let the segments $AB$ and $MK$ intersects at the point $P$ and the segments $AC$ and $MN$ intersects at the point $Q.$ Prove that $PQ\par... | [
"# Proof that $PQ \\parallel BC$",
"## Setup",
"Let $\\angle BAC = 2\\alpha$, $\\angle CBA = 2\\beta$, $\\angle ACB = 2\\gamma$, so that $\\alpha + \\beta + \\gamma = 90°$.",
"Since $M$, $N$, $K$ lie on the circumcircle at the bisector points, each is the **midpoint of the corresponding arc not containing the... | # Proof that $PQ \parallel BC$
## Setup
Let $\angle BAC = 2\alpha$, $\angle CBA = 2\beta$, $\angle ACB = 2\gamma$, so that $\alpha + \beta + \gamma = 90°$.
Since $M$, $N$, $K$ lie on the circumcircle at the bisector points, each is the **midpoint of the corresponding arc not containing the opposite vertex**:
- $M$: ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000860 |
Programming | - | medium | Is there a way to replace the last element in a Python list with another list? | [
"# Replacing the Last Element in a Python List",
"It depends on what you mean by \"replace with another list.\" Here are the common cases:",
"## 1.",
"Replace the last element *with* a list (nesting)",
"The last element simply becomes a list object:",
"```python\nlst = [1, 2, 3]\nlst[-1] = [4, 5, 6]\nprin... | # Replacing the Last Element in a Python List
It depends on what you mean by "replace with another list." Here are the common cases:
## 1. Replace the last element *with* a list (nesting)
The last element simply becomes a list object:
```python
lst = [1, 2, 3]
lst[-1] = [4, 5, 6]
print(lst) # [1, 2, [4, 5, 6]]
```... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000861 |
Mathematics | - | medium | Example 1. Find the function $w=f(z)$ that conformally maps the upper half-plane $\operatorname{Im} z>0$ onto the region
$$
0<\arg w<\alpha \pi, \quad \text { where } \quad 0<\alpha<2
$$
of the $w$-plane. | [
"# Conformal Map from the Upper Half-Plane to a Sector",
"## Setting Up the Problem",
"We need a conformal map $w = f(z)$ from the upper half-plane $\\operatorname{Im}z > 0$ onto the sector\n$$0 < \\arg w < \\alpha\\pi, \\qquad 0 < \\alpha < 2.$$",
"## Solution: A Power Function",
"Write a point $z$ in the ... | # Conformal Map from the Upper Half-Plane to a Sector
## Setting Up the Problem
We need a conformal map $w = f(z)$ from the upper half-plane $\operatorname{Im}z > 0$ onto the sector
$$0 < \arg w < \alpha\pi, \qquad 0 < \alpha < 2.$$
## Solution: A Power Function
Write a point $z$ in the upper half-plane in polar fo... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000862 |
Artificial Intelligence | Logic Puzzle | easy | If I had $100 in my wallet this morning but I spent $30 on lunch, how much money is in my wallet right now? | [
"You have **$70** left in your wallet.",
"$100 − $30 = $70"
] | You have **$70** left in your wallet.
$100 − $30 = $70 | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000863 |
Mathematics | - | hard | Solve the equation $x = \sqrt{a - \sqrt{a + x}}$ where $a$ is a parameter. | [
"# Solving $x = \\sqrt{a - \\sqrt{a + x}}$",
"## Establishing the Domain",
"Since $x$ equals a square root, we need $x \\ge 0$.",
"The expression is defined only when:",
"- $a + x \\ge 0$ (inner radical)\n- $a - \\sqrt{a+x} \\ge 0$, i.e. $\\sqrt{a+x} \\le a$ (outer radical)",
"The last condition forces $a... | # Solving $x = \sqrt{a - \sqrt{a + x}}$
## Establishing the Domain
Since $x$ equals a square root, we need $x \ge 0$. The expression is defined only when:
- $a + x \ge 0$ (inner radical)
- $a - \sqrt{a+x} \ge 0$, i.e. $\sqrt{a+x} \le a$ (outer radical)
The last condition forces $a \ge 0$ and $a + x \le a^2$, so $x ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000864 |
Programming | - | hard | Write a Spring Boot (Java) backend service exposing full CRUD (Create, Read, Update, Delete) for sessions. Include: API key authentication, multi-field sorting, OAuth2 scope checks, bulk delete endpoint, error handling middleware. Use environment variables for all configuration. | [
"# Spring Boot Sessions CRUD Service",
"## Project Structure",
"```\nsrc/main/java/com/example/sessions/\n├── SessionsApplication.java\n├── config/\n│ ├── SecurityConfig.java\n│ ├── ApiKeyProperties.java\n│ └── CorsConfig.java\n├── controller/\n│ └── SessionController.java\n├── dto/\n│ ├── SessionRequ... | # Spring Boot Sessions CRUD Service
## Project Structure
```
src/main/java/com/example/sessions/
├── SessionsApplication.java
├── config/
│ ├── SecurityConfig.java
│ ├── ApiKeyProperties.java
│ └── CorsConfig.java
├── controller/
│ └── SessionController.java
├── dto/
│ ├── SessionRequest.java
│ ├── Sessio... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000865 |
Artificial Intelligence | Logic Puzzle | easy | A sofa costs $600 more than the chair. The chair costs $300 more than the lamp. If the total for all three is $1,800, how much is the lamp? | [
"## Setting Up the Problem",
"Let me assign a variable to the lamp's cost and express the others in terms of it:",
"| Item | Cost |\n|------|------|\n| Lamp | **L** |\n| Chair | L + $300 |\n| Sofa | (L + $300) + $600 = L + $900 |",
"## Solving",
"Since all three together cost $1,800:",
"$$L + (L + 300) + ... | ## Setting Up the Problem
Let me assign a variable to the lamp's cost and express the others in terms of it:
| Item | Cost |
|------|------|
| Lamp | **L** |
| Chair | L + $300 |
| Sofa | (L + $300) + $600 = L + $900 |
## Solving
Since all three together cost $1,800:
$$L + (L + 300) + (L + 900) = 1{,}800$$
$$3L +... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000866 |
Programming | Python | hard | Meka-Naruto plays a computer game. His character has the following ability: given an enemy hero, deal a instant damage to him, and then heal that enemy b health points at the end of every second, for exactly c seconds, starting one second after the ability is used. That means that if the ability is used at time t, the ... | [
"Looking at this problem, I need to find the maximum initial enemy health that can be killed by repeatedly casting the ability every `d` seconds.",
"**Key Analysis:**",
"1. **When is the answer -1?** In steady state, each cycle of `d` seconds deals `a` damage and `c·b` total heal (each spell contributes exactly... | Looking at this problem, I need to find the maximum initial enemy health that can be killed by repeatedly casting the ability every `d` seconds.
**Key Analysis:**
1. **When is the answer -1?** In steady state, each cycle of `d` seconds deals `a` damage and `c·b` total heal (each spell contributes exactly `c` heal eve... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000867 |
Mathematics | - | hard | Let $f(x) = \frac{x-e}{e^x}$ where $e$ is the base of the natural logarithm.
(1) Find the intervals where $f(x)$ is monotonically increasing/decreasing and its maximum value.
(2) If for any $x \in (0, +\infty)$, $2|\ln x - \ln 2| \geq f(x) + c - \frac{1}{e^2}$ always holds, find the range of values for the real numbe... | [
"# Solution",
"## Part (1): Monotonicity and Maximum of $f(x)$",
"**Computing the derivative.** Writing $f(x) = \\dfrac{x-e}{e^x}$, the quotient rule gives",
"$$f'(x) = \\frac{1\\cdot e^x - (x-e)\\,e^x}{e^{2x}} = \\frac{1-(x-e)}{e^x} = \\frac{e+1-x}{e^x}.$$",
"**Critical point.** Setting $f'(x)=0$:",
"$$e... | # Solution
## Part (1): Monotonicity and Maximum of $f(x)$
**Computing the derivative.** Writing $f(x) = \dfrac{x-e}{e^x}$, the quotient rule gives
$$f'(x) = \frac{1\cdot e^x - (x-e)\,e^x}{e^{2x}} = \frac{1-(x-e)}{e^x} = \frac{e+1-x}{e^x}.$$
**Critical point.** Setting $f'(x)=0$:
$$e+1-x = 0 \implies x = e+1.$$
*... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000868 |
Programming | - | medium | On a planet far, far away, M languages are spoken. They are conveniently numbered 1 through M.
For CODE FESTIVAL 20XX held on this planet, N participants gathered from all over the planet.
The i-th (1≦i≦N) participant can speak K_i languages numbered L_{i,1}, L_{i,2}, ..., L_{i,{}K_i}.
Two participants A and B can c... | [
"Looking at this problem, I need to determine if all participants form a single connected group where connections are made through shared languages.",
"**Key Insight:** This is a connectivity problem on a bipartite graph (participants ↔ languages).",
"Two participants are connected if there's a path between the... | Looking at this problem, I need to determine if all participants form a single connected group where connections are made through shared languages.
**Key Insight:** This is a connectivity problem on a bipartite graph (participants ↔ languages). Two participants are connected if there's a path between them through shar... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000869 |
Mathematics | - | hard | Determine the dimension of the tangent space at a point where multiple circles intersect in \(\mathbb{R}^2\). | [
"# Tangent Space at a Common Intersection of Circles in $\\mathbb{R}^2$",
"## Setup",
"Let $C_1, C_2, \\dots, C_n$ be circles in $\\mathbb{R}^2$, each defined by a polynomial equation",
"$$f_i(x,y) \\;=\\; x^2 + y^2 + D_i x + E_i y + F_i \\;=\\; 0,$$",
"and suppose they all pass through a common point $P$."... | # Tangent Space at a Common Intersection of Circles in $\mathbb{R}^2$
## Setup
Let $C_1, C_2, \dots, C_n$ be circles in $\mathbb{R}^2$, each defined by a polynomial equation
$$f_i(x,y) \;=\; x^2 + y^2 + D_i x + E_i y + F_i \;=\; 0,$$
and suppose they all pass through a common point $P$. The intersection variety is
... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000870 |
Artificial Intelligence | Logic Puzzle | medium | A metal bucket filled with water floats in a large pool. If a heavy lead weight is thrown out of the bucket so that it sinks to the bottom of the pool, will the water level of the pool rise, fall, or stay the same? | [
"## The Water Level **Falls**",
"### The key principle",
"Archimedes' principle tells us two different things depending on whether an object is floating or submerged:",
"- **Floating object** (in the bucket): displaces a volume of pool water whose *weight* equals the object's weight.\n $$V_{\\text{displaced}... | ## The Water Level **Falls**
### The key principle
Archimedes' principle tells us two different things depending on whether an object is floating or submerged:
- **Floating object** (in the bucket): displaces a volume of pool water whose *weight* equals the object's weight.
$$V_{\text{displaced}} = \frac{m_{\text{... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000871 |
Artificial Intelligence | Temporal Sequences | easy | Today, Elizabeth went to the art studio. Between what times could they have gone?
We know that:
Elizabeth woke up at 6am.
Sean saw Elizabeth buying lunch at the deli from 6am to 8am.
Lisa saw Elizabeth working at the office from 8am to 9am.
David saw Elizabeth stretching at a yoga studio from 12pm to 1pm.
Samantha saw ... | [
"## Answer: **(A) 9am to 12pm**",
"Here's how I worked it out by building Elizabeth's schedule:",
"| Time | Activity |\n|------|----------|\n| 6am – 8am | Buying lunch at the deli |\n| 8am – 9am | Working at the office |\n| 9am – 12pm | **Free / unaccounted for** |\n| 12pm – 1pm | Stretching at the yoga studio ... | ## Answer: **(A) 9am to 12pm**
Here's how I worked it out by building Elizabeth's schedule:
| Time | Activity |
|------|----------|
| 6am – 8am | Buying lunch at the deli |
| 8am – 9am | Working at the office |
| 9am – 12pm | **Free / unaccounted for** |
| 12pm – 1pm | Stretching at the yoga studio |
| 1pm – 5pm | Wa... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000872 |
Artificial Intelligence | Logic Puzzle | easy | I am driving my dog to the vet. If I stop at the car wash to clean the windows, where is my dog? | [
"Your dog is in the car with you.",
"You'd be sitting in the vehicle (likely the driver's seat) while the car goes through the wash, with your dog secured in the back or in a crate/carrier.",
"You wouldn't leave a pet in the car unattended, and the car wash is just a quick stop en route to the vet.",
"Is ther... | Your dog is in the car with you. You'd be sitting in the vehicle (likely the driver's seat) while the car goes through the wash, with your dog secured in the back or in a crate/carrier. You wouldn't leave a pet in the car unattended, and the car wash is just a quick stop en route to the vet.
Is there something specifi... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000873 |
Programming | Python | hard | Inna and Dima decided to surprise Sereja. They brought a really huge candy matrix, it's big even for Sereja! Let's number the rows of the giant matrix from 1 to n from top to bottom and the columns — from 1 to m, from left to right. We'll represent the cell on the intersection of the i-th row and j-th column as (i, j).... | [
"Looking at this problem, I need to track how each candy's coordinates change through three sequential transformations: clockwise 90° rotations, horizontal (left-right) mirrors, and counterclockwise 90° rotations.",
"**Key observations:**\n- CW 90° rotation on an R×C matrix: `(i,j) → (j, R-i+1)`, new size C×R\n- ... | Looking at this problem, I need to track how each candy's coordinates change through three sequential transformations: clockwise 90° rotations, horizontal (left-right) mirrors, and counterclockwise 90° rotations.
**Key observations:**
- CW 90° rotation on an R×C matrix: `(i,j) → (j, R-i+1)`, new size C×R
- Horizontal ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000874 |
Science | - | hard | What novel stochastic differential equation frameworks can capture the interplay between climate‑driven habitat fragmentation and adaptive gene‑regulatory network dynamics to forecast species persistence under extreme environmental perturbations? | [
"# Stochastic Differential Equation Frameworks for Climate–Genotype–Phenotype Coupling under Fragmentation",
"This is a genuinely open problem at the intersection of stochastic analysis, spatial ecology, and systems biology.",
"No single published framework currently unifies all the layers you name.",
"Below ... | # Stochastic Differential Equation Frameworks for Climate–Genotype–Phenotype Coupling under Fragmentation
This is a genuinely open problem at the intersection of stochastic analysis, spatial ecology, and systems biology. No single published framework currently unifies all the layers you name. Below I sketch several co... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000875 |
Artificial Intelligence | Logic Puzzle | medium | I am sending three vintage watches to a restorer. It takes 4 days to restore one watch. If I deliver one watch every morning, how many days will pass until the restorer has finished all three? | [
"## Setting Up the Problem",
"The key detail is that **one restorer** takes **4 days per watch**, and can only work on **one watch at a time**.",
"The fact that you deliver the watches on consecutive mornings doesn't speed things up, since the restorer is still busy with the first watch when the others arrive."... | ## Setting Up the Problem
The key detail is that **one restorer** takes **4 days per watch**, and can only work on **one watch at a time**. The fact that you deliver the watches on consecutive mornings doesn't speed things up, since the restorer is still busy with the first watch when the others arrive.
## Tracking E... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000876 |
Programming | - | medium | Incorporate this change into the code: "Allow mutiple hooks for packets" See the Python code below from the file proxy/plugins/plugins.py. ```python packetFunctions = {} commands = {} onStart = [] onConnection = [] onConnectionLoss = [] class packetHook(object): def __init__(self, pktType, pktSubtype): self.pktTyp... | [
"Here's the modified code with `packetFunctions` changed to support multiple hooks per packet type/subtype by using a list of functions as the value:",
"```python\npacketFunctions = {}\ncommands = {}\nonStart = []\nonConnection = []\nonConnectionLoss = []",
"class packetHook(object):\n def __init__(self, pkt... | Here's the modified code with `packetFunctions` changed to support multiple hooks per packet type/subtype by using a list of functions as the value:
```python
packetFunctions = {}
commands = {}
onStart = []
onConnection = []
onConnectionLoss = []
class packetHook(object):
def __init__(self, pktType, pktSubtype):
... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000877 |
Programming | - | hard | Walk through a system design for a social-media news feed / timeline system. Key constraints: fan-out on write vs fan-out on read for 203M DAU; ranked feed using a lightweight ML scoring service. Cover: data model / schema, high-level component diagram, database choice and justification, API design. | [
"# Social-Media News Feed / Timeline System — 203 M DAU",
"---",
"## 1.",
"The Core Dilemma: Fan-out on Write vs.",
"Fan-out on Read",
"Before any schema, you must resolve the architectural fork because it dictates everything downstream.",
"| | **Fan-out on Write** | **Fan-out on Read** |\n|---|---|---|... | # Social-Media News Feed / Timeline System — 203 M DAU
---
## 1. The Core Dilemma: Fan-out on Write vs. Fan-out on Read
Before any schema, you must resolve the architectural fork because it dictates everything downstream.
| | **Fan-out on Write** | **Fan-out on Read** |
|---|---|---|
| **Write path** | 1 post → N f... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000878 |
Programming | Cpp | hard | Mole is hungry again. He found one ant colony, consisting of n ants, ordered in a row. Each ant i (1 ≤ i ≤ n) has a strength si.
In order to make his dinner more interesting, Mole organizes a version of «Hunger Games» for the ants. He chooses two numbers l and r (1 ≤ l ≤ r ≤ n) and each pair of ants with indices betwe... | [
"Looking at this problem, I need to find for each query [l, r] how many ants are **eaten** (not freed).",
"**Key Insight:** An ant *i* is freed if it scores a point against **every** other ant in [l, r], meaning s_i divides s_j for all j ≠ i in the range.",
"But since g = gcd(s_l, ..., s_r) divides s_i, the con... | Looking at this problem, I need to find for each query [l, r] how many ants are **eaten** (not freed).
**Key Insight:** An ant *i* is freed if it scores a point against **every** other ant in [l, r], meaning s_i divides s_j for all j ≠ i in the range. But since g = gcd(s_l, ..., s_r) divides s_i, the condition "s_i di... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000879 |
Artificial Intelligence | Logic Puzzle | medium | It takes 4 painters 4 hours to paint a fence. If I hire 4 more painters but they only have one ladder, how many hours will it take to paint the fence? | [
"## The Trick: Only One Painter Can Work at a Time",
"The \"obvious\" math says: 4 painters × 4 hours = 16 painter-hours of work, so 8 painters would finish in **2 hours**.",
"But the constraint changes everything.",
"With **only one ladder**, only **one painter can be on the fence at a time**.",
"The other... | ## The Trick: Only One Painter Can Work at a Time
The "obvious" math says: 4 painters × 4 hours = 16 painter-hours of work, so 8 painters would finish in **2 hours**.
But the constraint changes everything. With **only one ladder**, only **one painter can be on the fence at a time**. The other seven are just standing ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000880 |
Programming | - | hard | Momiji has got a rooted tree, consisting of n nodes. The tree nodes are numbered by integers from 1 to n. The root has number 1. Momiji decided to play a game on this tree.
The game consists of several steps. On each step, Momiji chooses one of the remaining tree nodes (let's denote it by v) and removes all the subtre... | [
"Looking at this problem, I need to find the expected number of steps in a game where we randomly pick remaining nodes and remove their subtrees.",
"**Key Insight (Linearity of Expectation):**",
"The number of steps equals the number of nodes that actually get \"picked.\" A node `v` gets picked if and only if i... | Looking at this problem, I need to find the expected number of steps in a game where we randomly pick remaining nodes and remove their subtrees.
**Key Insight (Linearity of Expectation):**
The number of steps equals the number of nodes that actually get "picked." A node `v` gets picked if and only if it is chosen bef... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000881 |
Programming | - | medium | Polycarpus has n friends in Tarasov city. Polycarpus knows phone numbers of all his friends: they are strings s1, s2, ..., sn. All these strings consist only of digits and have the same length. Once Polycarpus needed to figure out Tarasov city phone code. He assumed that the phone code of the city is the longest common... | [
"Looking at this problem, I need to find the length of the longest common prefix among all phone numbers.",
"**Approach:** Compare character by character from left to right across all strings.",
"The LCP length is the first position where not all strings agree.",
"```python\nn = int(input())\nstrings = [input... | Looking at this problem, I need to find the length of the longest common prefix among all phone numbers.
**Approach:** Compare character by character from left to right across all strings. The LCP length is the first position where not all strings agree.
```python
n = int(input())
strings = [input().strip() for _ in ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000882 |
Programming | - | medium | It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day he invents some game and plays in it alone or with friends.
Today he invented one simple game to play with Lena, with whom he shares a desk. The rules are simple. Sasha draws n sticks in a row. After that the players tak... | [
"Looking at this problem, I need to determine how many total moves are made in the game.",
"**Key Insight:** Each move removes exactly k sticks (from either end), so the total number of sticks just decreases by k each turn regardless of which end is chosen.",
"The game ends when fewer than k sticks remain.",
... | Looking at this problem, I need to determine how many total moves are made in the game.
**Key Insight:** Each move removes exactly k sticks (from either end), so the total number of sticks just decreases by k each turn regardless of which end is chosen. The game ends when fewer than k sticks remain.
- Total number of... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000883 |
Programming | - | medium | How can I create a sorted array from an unsorted array using quicksort in Python? | [
"# Quicksort in Python",
"Quicksort works by:\n1. **Picking a pivot** element from the array.\n2. **Partitioning** the array so elements less than the pivot go left, and elements greater go right.\n3. **Recursing** on the left and right sub-arrays.",
"## Simple Implementation (readable)",
"```python\ndef quic... | # Quicksort in Python
Quicksort works by:
1. **Picking a pivot** element from the array.
2. **Partitioning** the array so elements less than the pivot go left, and elements greater go right.
3. **Recursing** on the left and right sub-arrays.
## Simple Implementation (readable)
```python
def quicksort(arr):
if le... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000884 |
Artificial Intelligence | Tracking Shuffled Objects Three Objects | easy | Alice, Bob, and Claire are holding a white elephant gift exchange. At the start of the event, they are each holding a present of a different color: Alice has a orange ball, Bob has a black ball, and Claire has a brown present.
As the event progresses, pairs of people swap gifts. First, Alice and Claire swap their gifts... | [
"## Tracing the Gift Exchanges",
"Let me track who holds what at each step:",
"**Initial:**\n- Alice: orange ball\n- Bob: black ball\n- Claire: brown present",
"**After Alice & Claire swap:**\n- Alice: brown present\n- Bob: black ball\n- Claire: orange ball",
"**After Bob & Claire swap:**\n- Alice: brown pr... | ## Tracing the Gift Exchanges
Let me track who holds what at each step:
**Initial:**
- Alice: orange ball
- Bob: black ball
- Claire: brown present
**After Alice & Claire swap:**
- Alice: brown present
- Bob: black ball
- Claire: orange ball
**After Bob & Claire swap:**
- Alice: brown present
- Bob: orange ball
- C... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000885 |
Programming | - | medium | Write a function find_arithmetic_triplets that takes a list of integers nums and an integer diff as inputs. The function should return the number of unique arithmetic triplets in the list. An arithmetic triplet is a set of three numbers that are 'diff' apart from each other in the list. For example, in the list [0, 1, ... | [
"Looking at this problem, I need to find the count of triplets (a, a+diff, a+2*diff) where all three numbers exist in the given list.",
"**Approach:**\n1.",
"Convert the list to a set for O(1) lookup\n2.",
"For each number `a` in the set, check if both `a + diff` and `a + 2*diff` also exist in the set\n3.",
... | Looking at this problem, I need to find the count of triplets (a, a+diff, a+2*diff) where all three numbers exist in the given list.
**Approach:**
1. Convert the list to a set for O(1) lookup
2. For each number `a` in the set, check if both `a + diff` and `a + 2*diff` also exist in the set
3. Count valid triplets
Eac... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000886 |
Programming | - | hard | Petya learned a new programming language CALPAS. A program in this language always takes one non-negative integer and returns one non-negative integer as well.
In the language, there are only three commands: apply a bitwise operation AND, OR or XOR with a given constant to the current integer. A program can contain an... | [
"Looking at this problem, I need to find that any sequence of AND/OR/XOR operations with 10-bit constants reduces to a per-bit transformation.",
"Each bit can only end up as: `x`, `1-x`, `0`, or `1`.",
"**Key Insight:** I can track each bit's state through the entire program, then reconstruct the result with at... | Looking at this problem, I need to find that any sequence of AND/OR/XOR operations with 10-bit constants reduces to a per-bit transformation. Each bit can only end up as: `x`, `1-x`, `0`, or `1`.
**Key Insight:** I can track each bit's state through the entire program, then reconstruct the result with at most 2 operat... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000887 |
Programming | - | medium | Given an array arr[ ] of size N having elements, the task is to find the next greater element for each element of the array in order of their appearance in the array. Next greater element of an element in the array is the nearest element on the right which is greater than the current element. If there does not exist ne... | [
"```python\ndef nextLargerElement(arr, n):\n result = [-1] * n\n stack = []",
"for i in range(n - 1, -1, -1):\n # Pop elements from stack that are smaller than or equal to current element\n while stack and stack[-1] <= arr[i]:\n stack.pop()",
"# If stack is not empty, top is the n... | ```python
def nextLargerElement(arr, n):
result = [-1] * n
stack = []
for i in range(n - 1, -1, -1):
# Pop elements from stack that are smaller than or equal to current element
while stack and stack[-1] <= arr[i]:
stack.pop()
# If stack is not empty, top is ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000888 |
Science | - | hard | In strongly correlated electron systems, how does the coupling between orbital-selective Mott transitions and lattice anharmonicity give rise to emergent nematic superconductivity under high pressure, and what spectroscopic signatures uniquely identify this state? | [
"# Orbital-Selective Mott Transitions, Lattice Anharmonicity, and Nematic Superconductivity",
"This question weaves together several genuinely rich areas of strongly correlated physics, but I want to be upfront: **the specific unified mechanism you describe — a single, well-defined pathway by which the *coupling*... | # Orbital-Selective Mott Transitions, Lattice Anharmonicity, and Nematic Superconductivity
This question weaves together several genuinely rich areas of strongly correlated physics, but I want to be upfront: **the specific unified mechanism you describe — a single, well-defined pathway by which the *coupling* of orbit... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000889 |
Science | - | hard | What are the mechanistic pathways by which stratospheric sudden warmings alter the vertical coupling of tropospheric ozone chemistry and mesoscale convective organization, and how can these processes be quantified in coupled climate‑chemistry models? | [
"# Stratospheric Sudden Warmings, Tropospheric Ozone, and Mesoscale Convection: Mechanistic Links and Quantification",
"## An Important Preliminary Caveat",
"Before unpacking the individual threads, I need to be direct: the specific composite pathway your question presupposes—that SSWs mechanistically alter the... | # Stratospheric Sudden Warmings, Tropospheric Ozone, and Mesoscale Convection: Mechanistic Links and Quantification
## An Important Preliminary Caveat
Before unpacking the individual threads, I need to be direct: the specific composite pathway your question presupposes—that SSWs mechanistically alter the *vertical co... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000890 |
Mathematics | - | hard | Give an example of a function \( f: \mathbb{R} \to \mathbb{R} \) with lateral limits at every point such that \( f(\mathbb{R}) = \mathbb{Q} \). | [
"# A Step Function with Rational Image and One-Sided Limits Everywhere",
"## Construction",
"Let $\\mathbb{Q}=\\{q_1,\\,q_2,\\,q_3,\\ldots\\}$ be any fixed enumeration of the rationals, and let $g:\\mathbb{Z}\\to\\mathbb{Q}$ be any surjection, for instance",
"$$\ng(n)=\\begin{cases} q_{2n} & n\\ge 1,\\\\ q_1 ... | # A Step Function with Rational Image and One-Sided Limits Everywhere
## Construction
Let $\mathbb{Q}=\{q_1,\,q_2,\,q_3,\ldots\}$ be any fixed enumeration of the rationals, and let $g:\mathbb{Z}\to\mathbb{Q}$ be any surjection, for instance
$$
g(n)=\begin{cases} q_{2n} & n\ge 1,\\ q_1 & n=0,\\ q_{2|n|+1} & n\le -1.\... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000891 |
Science | Physical Chemistry | hard | Consider the 4\(\pi\) electrons in cyclobutadiene to be free particles in a 2-dimensional square box of length 2 Å. Calculate the wavelength of the electronic transition from the HOMO to LUMO. Write down the normalized wave functions for the occupied degenerate states. [JAM 2007] | [
"# Free-Particle Model of Cyclobutadiene in a 2D Square Box",
"## Setting Up the Energy Levels",
"For a 2-D square box of side $L = 2$ Å, the allowed energies are",
"$$E_{n_x,n_y} = \\frac{h^2}{8mL^2}\\left(n_x^2 + n_y^2\\right), \\qquad n_x,n_y = 1,2,3,\\dots$$",
"| State $(n_x,n_y)$ | $n_x^2+n_y^2$ | Dege... | # Free-Particle Model of Cyclobutadiene in a 2D Square Box
## Setting Up the Energy Levels
For a 2-D square box of side $L = 2$ Å, the allowed energies are
$$E_{n_x,n_y} = \frac{h^2}{8mL^2}\left(n_x^2 + n_y^2\right), \qquad n_x,n_y = 1,2,3,\dots$$
| State $(n_x,n_y)$ | $n_x^2+n_y^2$ | Degeneracy | Capacity |
|---|-... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000892 |
Science | - | hard | What novel statistical framework can integrate satellite-derived radiative flux anomalies with deep generative climate models to quantify uncertainty in regional precipitation extremes under high-emission scenarios, accounting for non-stationary teleconnections? | [
"# A Radiative-Conditioned Non-Stationary Generative Framework for Precipitation Extremes",
"This is a genuinely open problem at the intersection of satellite energetics, deep generative modeling, and extreme-value statistics.",
"Below I lay out a concrete, multi-layer framework I'll call **RADIO-GEP** (Radiati... | # A Radiative-Conditioned Non-Stationary Generative Framework for Precipitation Extremes
This is a genuinely open problem at the intersection of satellite energetics, deep generative modeling, and extreme-value statistics. Below I lay out a concrete, multi-layer framework I'll call **RADIO-GEP** (Radiative Anomaly–con... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000893 |
Mathematics | - | medium | Determine the set of real numbers \( c \) such that the equation \( \frac{\log_2 x}{x} = c \) has only one real solution. | [
"# Finding $c$ for a Unique Solution of $\\frac{\\log_2 x}{x} = c$",
"## Setting Up the Function",
"Define $f(x) = \\dfrac{\\log_2 x}{x} = \\dfrac{\\ln x}{x\\ln 2}$ for $x > 0$.",
"I'll analyze $g(x) = \\dfrac{\\ln x}{x}$ and scale by $\\frac{1}{\\ln 2}$ afterward.",
"## Analyzing the Shape of $f$",
"**De... | # Finding $c$ for a Unique Solution of $\frac{\log_2 x}{x} = c$
## Setting Up the Function
Define $f(x) = \dfrac{\log_2 x}{x} = \dfrac{\ln x}{x\ln 2}$ for $x > 0$.
I'll analyze $g(x) = \dfrac{\ln x}{x}$ and scale by $\frac{1}{\ln 2}$ afterward.
## Analyzing the Shape of $f$
**Derivative:**
$$g'(x) = \frac{1 - \ln ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000894 |
Programming | - | medium | Create a method to print all the prime numbers up to n. Write corresponding code in Python. | [
"# Printing All Prime Numbers Up to N",
"## Approach 1: Trial Division (Simple)",
"Check each number from 2 to `n` for divisibility up to its square root.",
"```python\ndef is_prime(num):\n \"\"\"Check if a single number is prime.\"\"\"\n if num < 2:\n return False\n if num == 2:\n retu... | # Printing All Prime Numbers Up to N
## Approach 1: Trial Division (Simple)
Check each number from 2 to `n` for divisibility up to its square root.
```python
def is_prime(num):
"""Check if a single number is prime."""
if num < 2:
return False
if num == 2:
return True
if num % 2 == 0:
... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000895 |
Science | - | hard | In a hybrid quantum‑classical molecular dynamics framework, how can one rigorously incorporate non‑adiabatic electron–nuclear coupling to predict catalytic turnover frequencies for metal‑organic frameworks undergoing multi‑electron redox cycles? | [
"# Non-Adiabatic Hybrid QM/MM Dynamics for Multi-Electron Catalysis in MOFs",
"This is one of the most demanding problems at the interface of computational chemistry and catalysis.",
"There is no single off-the-shelf protocol; a rigorous treatment requires carefully stitching together several layers, each of wh... | # Non-Adiabatic Hybrid QM/MM Dynamics for Multi-Electron Catalysis in MOFs
This is one of the most demanding problems at the interface of computational chemistry and catalysis. There is no single off-the-shelf protocol; a rigorous treatment requires carefully stitching together several layers, each of which introduces... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000896 |
Mathematics | - | medium | Determine the number of different monic quadratic polynomials with integer coefficients such that they have two distinct roots, each being a power of 5 with natural exponents, and their coefficients do not exceed in absolute value \(125^{48}\). | [
"Looking at this problem, I need to find monic quadratics $(x-5^a)(x-5^b)$ with distinct natural number exponents $a \\neq b$, where all coefficients satisfy $|c| \\leq 125^{48}$.",
"## Setting Up the Polynomial",
"The monic quadratic with roots $5^a$ and $5^b$ is:\n$$p(x) = x^2 - (5^a + 5^b)\\,x + 5^{a+b}$$",
... | Looking at this problem, I need to find monic quadratics $(x-5^a)(x-5^b)$ with distinct natural number exponents $a \neq b$, where all coefficients satisfy $|c| \leq 125^{48}$.
## Setting Up the Polynomial
The monic quadratic with roots $5^a$ and $5^b$ is:
$$p(x) = x^2 - (5^a + 5^b)\,x + 5^{a+b}$$
Since $125^{48} = ... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000897 |
Programming | - | hard | When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.
You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..... | [
"Looking at this problem, I need to find the median (N/2-th largest = N/2-th smallest) of the remaining N-1 elements for each removal.",
"## Key Insight",
"After sorting the array as Y₁ ≤ Y₂ ≤ ... ≤ Y_N with k = N/2:",
"- The median of N-1 remaining elements is the **k-th smallest** of those elements.\n- If t... | Looking at this problem, I need to find the median (N/2-th largest = N/2-th smallest) of the remaining N-1 elements for each removal.
## Key Insight
After sorting the array as Y₁ ≤ Y₂ ≤ ... ≤ Y_N with k = N/2:
- The median of N-1 remaining elements is the **k-th smallest** of those elements.
- If the removed element... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000898 |
Mathematics | - | hard | Let \(\alpha\), \(\beta\), and \(\gamma\) be positive real numbers such that \(\alpha + \beta + \gamma = \frac{\pi}{2}\). Calculate the minimum value of the expression
\[ \sec^2 \alpha (1+9 \tan \alpha) + \sec^2 \beta (1+9 \tan \beta) + \sec^2 \gamma (1+9 \tan \gamma) - 9 (\tan^4 \alpha + \tan^4 \beta + \tan^4 \gamma).... | [
"# Finding the Minimum Value",
"## Setting Up the Problem",
"Let me substitute $x = \\tan\\alpha$, $y = \\tan\\beta$, $z = \\tan\\gamma$.",
"Since $\\alpha + \\beta + \\gamma = \\frac{\\pi}{2}$, the tangent addition formula gives the constraint:",
"$$xy + yz + zx = 1$$",
"Rewriting the expression using $\... | # Finding the Minimum Value
## Setting Up the Problem
Let me substitute $x = \tan\alpha$, $y = \tan\beta$, $z = \tan\gamma$. Since $\alpha + \beta + \gamma = \frac{\pi}{2}$, the tangent addition formula gives the constraint:
$$xy + yz + zx = 1$$
Rewriting the expression using $\sec^2\theta = 1 + \tan^2\theta$:
$$\... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000899 |
Programming | Cpp | medium | Little kids, Jack and Evan like playing their favorite game Glass-and-Stone. Today they want to play something new and came across Twitter on their father's laptop.
They saw it for the first time but were already getting bored to see a bunch of sentences having at most 140 characters each. The only thing they liked to... | [
"# Solution",
"This is a straightforward simulation problem.",
"We maintain the state of each tweet and a running count of open tweets.",
"## Approach",
"- Use a boolean array to track whether each tweet is open or closed.\n- Keep a counter for the number of open tweets.\n- For `CLICK X`: toggle tweet X and... | # Solution
This is a straightforward simulation problem. We maintain the state of each tweet and a running count of open tweets.
## Approach
- Use a boolean array to track whether each tweet is open or closed.
- Keep a counter for the number of open tweets.
- For `CLICK X`: toggle tweet X and update the counter.
- F... | Review the intermediate steps and independently check the final result against the question. | Skipping an assumption or accepting the final result without an independent check. | the-forge-000900 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.