Round #578
09 May 2026, 23:17· 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
Pivot a table of monthly_sales (month, year, total) to columns per month.
Zero-point index (what the engine surfaced)
ZPI-ZPI-0012 | 2026-05-09T23:17:46Z
Pivot a table of monthly_sales (month, year, total) to columns per month.
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.Collections.Generic;
using System.Linq;
public class MonthlySales
{
public string Month { get; set; }
public int Year { get; set; }
public int Total { get; set; }
}
class Program
{
static void Main()
{
var monthlySales = new List<MonthlySales>
{
new MonthlySales { Month = "Jan", Year = 2022, Total = 100 },
new MonthlySales { Month = "Feb", Year = 2022, Total = 150 },
new MonthlySales { Month = "Mar", Year = 2022, Total = 120 },
new MonthlySales { Month = "Jan", Year = 2023, Total = 130 },
new MonthlySales { Month = "Feb", Year = 2023, Total = 160 },
new MonthlySales { Month = "Mar", Year = 2023, Total = 140 },
};
var pivotedSales = monthlySales.GroupBy(s => s.Year)
.Select(g => new
{
Year = g.Key,
Jan = g.Where(s => s.Month == "Jan").Select(s => s.Total).FirstOrDefault(),
Feb = g.Where(s => s.Month == "Feb").Select(s => s.Total).FirstOrDefault(),
Mar = g.Where(s => s.Month == "Mar").Select(s => s.Total).FirstOrDefault(),
});
foreach (var sale in pivotedSales)
{
Console.WriteLine($"Year: {sale.Year}, Jan: {sale.Jan}, Feb: {sale.Feb}, Mar: {sale.Mar}");
}
}
}
```
Enhanced response (with ZPI)
```csharp
using System;
using System.Data;
using System.Linq;
public class SalesPivot
{
public static DataTable PivotMonthlySales(DataTable monthlySales)
{
// Check if the input DataTable is empty
if (monthlySales.Rows.Count == 0)
{
throw new ArgumentException("Input DataTable is empty");
}
// Get unique months and years
var months = monthlySales.AsEnumerable().Select(r => r.Field<string>("month")).Distinct().OrderBy(m => m).ToList();
var years = monthlySales.AsEnumerable().Select(r => r.Field<int>("year")).Distinct().OrderBy(y => y).ToList();
// Create a new DataTable with pivoted columns
var pivotedTable = new DataTable();
pivotedTable.Columns.Add("year", typeof(int));
// Add columns for each month
foreach (var month in months)
{
pivotedTable.Columns.Add(month, typeof(int));
}
// Populate the pivoted DataTable
foreach (var year in years)
{
var newRow = pivotedTable.NewRow();
newRow["year"] = year;
foreach (var month in months)
{
var salesRow = monthlySales.AsEnumerable()
.FirstOrDefault(r => r.Field<string>("month") == month && r.Field<int>("year") == year);
if (salesRow != null)
{
newRow[month] = salesRow.Field<int>("total");
}
else
{
newRow[month] = DBNull.Value;
}
}
pivotedTable.Rows.Add(newRow);
}
return pivotedTable;
}
public static void Main()
{
// Example usage
var monthlySales = new DataTable();
monthlySales.Columns.Add("month", typeof(string));
monthlySales.Columns.Add("year", typeof(int));
monthlySales.Columns.Add("total", typeof(int));
monthlySales.Rows.Add("January", 2022, 100);
monthlySales.Rows.Add("February", 2022, 120);
monthlySales.Rows.Add("March", 2022, 150);
monthlySales.Rows.Add("January", 2023, 110);
monthlySales.Rows.Add("February", 2023, 130);
monthlySales.Rows.Add("March", 2023, 160);
var pivotedTable = PivotMonthlySales(monthlySales);
// Print the pivoted DataTable
foreach (DataColumn column in pivotedTable.Columns)
{
Console.Write(column.ColumnName + "\t");
}
Console.WriteLine();
foreach (DataRow row in pivotedTable.Rows)
{
foreach (object value in row.ItemArray)
{
Console.Write(value + "\t");
}
Console.WriteLine();
}
}
}
```
This C# code defines a method `PivotMonthlySales` that takes a `DataTable` containing monthly sales data and returns a new `DataTable` with the data pivoted to have columns for each month. The `Main` method demonstrates how to use this function with an example `DataTable`.
The `PivotMonthlySales` method first checks if the input `DataTable` is empty and throws an exception if it is. It then retrieves the unique months and years from the input data. A new `DataTable` is created with columns for each month, and the data is populated by iterating over the unique years and months.
The example usage in the `Main` method creates a sample `DataTable` with monthly sales data for two years, pivots the data using the `PivotMonthlySales` method, and prints the resulting pivoted `DataTable`.
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.