← CSES Better

COWBASIC

USACO · 2017 · US Open · platinum-3

Open official problem ↗
Ask AI

Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.

Open Claude Desktop

geometry · combinatorics · simulation

The organizer’s problem statement is available at the official source link.

sample trace

COWBASIC: geometry walkthrough

COWBASIC: use the linked editorial?s geometry, combinatorics idea on the published sample, then verify the displayed output.

Published inputx = 1 10 MOO { x = ( x ) + ( x ) } RETURN x n = 1 nsq = 1 100000 MOO { 100000 MOO { nsq = ( nsq ) + ( ( n ) + ( ( n ) + ( 1 ) ) ) n = ( n ) + ( 1 ) } } RETURN nsqmodelAlgorithm ideaTranslate the input into points or regions and reason with their order, containment, or intersection.task resultExpected output1024 4761
  1. 1

    Plot

    Place the relevant points or rectangle boundaries on a coordinate plane.
  2. 2

    Relate

    Use the task?s ordering, containment, or intersection condition to select valid geometry.
  3. 3

    Report

    Compute the requested geometric measure or selected set.
  4. 4

    Verify the sample

    Use the published sample output to check the result of this idea on the displayed input.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 chars

Run output

Run your code to see output.