Round #571
09 May 2026, 23:16· csharp· Meta-Llama-3.3-70B-Instruct· r13-clean-hints
- Complexity
- band 0
- ZP / UO / OBS
- 0 / 0 / 0
- Journey weight
- 0
- Lightshift ΔL
- —
Prompt
Find the second-highest salary in an employees table.
Zero-point index (what the engine surfaced)
ZPI-ZPI-0005 | 2026-05-09T23:16:11Z
Find the second-highest salary in an employees table.
ZERO POINT — 0 entries (structural invariants)
UNOBSERVED — 0 entries (implied truths)
OBSERVED — 0 entries (explicit in request)
COMPLEXITY │ 0 entries │ spread: 0° │ band: LOW
Baseline response (no ZPI)
```csharp
using System;
using System.Data;
using System.Linq;
public class Program
{
public static void Main()
{
// Create a sample DataTable
DataTable dt = new DataTable();
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Salary", typeof(int));
dt.Rows.Add("John", 50000);
dt.Rows.Add("Alice", 60000);
dt.Rows.Add("Bob", 40000);
dt.Rows.Add("Mary", 70000);
dt.Rows.Add("Peter", 45000);
// Find the second-highest salary
var secondHighestSalary = dt.AsEnumerable()
.OrderByDescending(r => r.Field<int>("Salary"))
.Select(r => r.Field<int>("Salary"))
.Distinct()
.Skip(1)
.FirstOrDefault();
Console.WriteLine(secondHighestSalary);
}
}
```
Enhanced response (with ZPI)
```csharp
using System;
using System.Data;
using System.Data.SqlClient;
public class EmployeeRepository
{
private readonly string _connectionString;
public EmployeeRepository(string connectionString)
{
_connectionString = connectionString;
}
public decimal? GetSecondHighestSalary()
{
using (var connection = new SqlConnection(_connectionString))
{
connection.Open();
var query = "SELECT DISTINCT salary FROM employees ORDER BY salary DESC OFFSET 1 ROWS FETCH NEXT 1 ROW ONLY";
using (var command = new SqlCommand(query, connection))
{
try
{
var result = command.ExecuteScalar();
if (result == null || result == DBNull.Value)
{
return null;
}
return Convert.ToDecimal(result);
}
catch (SqlException ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
return null;
}
}
}
}
}
class Program
{
static void Main(string[] args)
{
var connectionString = "Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;";
var repository = new EmployeeRepository(connectionString);
var secondHighestSalary = repository.GetSecondHighestSalary();
if (secondHighestSalary.HasValue)
{
Console.WriteLine($"The second-highest salary is: {secondHighestSalary}");
}
else
{
Console.WriteLine("No second-highest salary found.");
}
}
}
```
This C# code retrieves the second-highest salary from an `employees` table in a database. It uses ADO.NET to connect to the database and execute a SQL query. The query selects distinct salaries, orders them in descending order, skips the first row (the highest salary), and fetches the next row (the second-highest salary).
**Explanation:**
1. The `EmployeeRepository` class encapsulates the database connection and query execution.
2. The `GetSecondHighestSalary` method opens a database connection, executes the SQL query, and retrieves the result.
3. The query uses `DISTINCT` to remove duplicate salaries, `ORDER BY` to sort the salaries in descending order, `OFFSET` to skip the first row, and `FETCH NEXT` to retrieve the next row.
4. The method handles potential SQL exceptions and returns `null` if an error occurs or if no second-highest salary is found.
5. In the `Main` method, an instance of `EmployeeRepository` is created, and the `GetSecondHighestSalary` method is called to retrieve the second-highest salary. The result is then printed to the console.
Grader chain
Each grader reads the same baseline + enhanced pair and casts an independent verdict. Disagreement is the framework's own signal — not noise to be averaged away.
V1samba/Meta-Llama-3.3-70B-Instruct
BetterV4qwen2.5-coder-3b-instruct
BetterV5openrouter/qwen/qwen3-235b-a22b-2507
BetterV7qwen2.5-coder-7b-instruct
BetterV8openai/gpt-4.1
BetterV9anthropic/claude-opus-4-7
BetterV12openai/gpt-4o
BetterComments
Our grader said what it said. What do you say? Comment as a guest below.
No comments yet. Be the first to say what you make of this round.