Skip to content

[Frontier-CS-1.1] Sync algorithmic problems 301-305#109

Merged
joyemang33 merged 6 commits intoFrontierCS:mainfrom
Evier-C:codex/algorithmic-301-305
Apr 20, 2026
Merged

[Frontier-CS-1.1] Sync algorithmic problems 301-305#109
joyemang33 merged 6 commits intoFrontierCS:mainfrom
Evier-C:codex/algorithmic-301-305

Conversation

@Evier-C
Copy link
Copy Markdown
Contributor

@Evier-C Evier-C commented Apr 20, 2026

What changed

Replace algorithmic problems 301-305 with the current contents of synthetic problems 1-5.

Why

These five problems were updated to match the latest scoring rubric normalization:

  • minimization problems use baseline-relative ratios of the form (baseline - x) / baseline
  • maximization problems use ratios of the form (x - baseline) / x
  • statements describe per-test ratios and leave absolute point scaling to config.yaml

Impact

  • algorithmic/problems/301 now matches synthetic_problems/1
  • algorithmic/problems/302 now matches synthetic_problems/2
  • algorithmic/problems/303 now matches synthetic_problems/3
  • algorithmic/problems/304 now matches synthetic_problems/4
  • algorithmic/problems/305 now matches synthetic_problems/5

Validation

  • compiled checkers for algorithmic/problems/301 through algorithmic/problems/305
  • ran LightCPVerifier sanity submissions on the corresponding synthetic problems to confirm the updated scoring formulas executed end-to-end

@Evier-C Evier-C changed the title [codex] Sync algorithmic problems 301-305 [Frontier-CS-1.1] Sync algorithmic problems 301-305 Apr 20, 2026
@Evier-C Evier-C closed this Apr 20, 2026
@Evier-C Evier-C reopened this Apr 20, 2026
@Evier-C Evier-C marked this pull request as ready for review April 20, 2026 05:22
@joyemang33 joyemang33 requested a review from Copilot April 20, 2026 05:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Frontier-CS algorithmic problem set 301–305 to match the current versions of synthetic problems 1–5, including updated scoring normalization rules and refreshed public testdata/checkers.

Changes:

  • Replaced problem statements for 301–305 to reflect updated objective/scoring definitions.
  • Added/updated per-problem checkers (chk.cc) and configs (config.yaml) to implement the new baseline-relative scoring.
  • Refreshed public testdata/*.in (with placeholder .ans) for the updated problem set.

Reviewed changes

Copilot reviewed 27 out of 108 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
algorithmic/problems/301/chk.cc Checker for problem 301 scoring vs baseline selection.
algorithmic/problems/301/config.yaml Runner limits and testcase count for problem 301.
algorithmic/problems/301/statement.txt Updated problem 301 statement + scoring definition.
algorithmic/problems/301/testdata/1.in Public input case 1 for problem 301.
algorithmic/problems/301/testdata/1.ans Placeholder answer file for case 1.
algorithmic/problems/301/testdata/2.in Public input case 2 for problem 301.
algorithmic/problems/301/testdata/2.ans Placeholder answer file for case 2.
algorithmic/problems/301/testdata/3.in Public input case 3 for problem 301.
algorithmic/problems/301/testdata/3.ans Placeholder answer file for case 3.
algorithmic/problems/301/testdata/4.in Public input case 4 for problem 301.
algorithmic/problems/301/testdata/4.ans Placeholder answer file for case 4.
algorithmic/problems/301/testdata/5.in Public input case 5 for problem 301.
algorithmic/problems/301/testdata/5.ans Placeholder answer file for case 5.
algorithmic/problems/301/testdata/6.in Public input case 6 for problem 301.
algorithmic/problems/301/testdata/6.ans Placeholder answer file for case 6.
algorithmic/problems/301/testdata/7.in Public input case 7 for problem 301.
algorithmic/problems/301/testdata/7.ans Placeholder answer file for case 7.
algorithmic/problems/301/testdata/8.in Public input case 8 for problem 301.
algorithmic/problems/301/testdata/8.ans Placeholder answer file for case 8.
algorithmic/problems/301/testdata/9.in Public input case 9 for problem 301.
algorithmic/problems/301/testdata/9.ans Placeholder answer file for case 9.
algorithmic/problems/301/testdata/10.in Public input case 10 for problem 301.
algorithmic/problems/301/testdata/10.ans Placeholder answer file for case 10.
algorithmic/problems/302/chk.cc Checker for problem 302 (bigram + motif penalty) scoring vs baseline string.
algorithmic/problems/302/config.yaml Runner limits and testcase count for problem 302.
algorithmic/problems/302/generate_testdata.py Script to generate public testdata for problem 302.
algorithmic/problems/302/statement.txt Updated problem 302 statement + scoring definition.
algorithmic/problems/302/testdata/1.in Public input case 1 for problem 302.
algorithmic/problems/302/testdata/1.ans Placeholder answer file for case 1.
algorithmic/problems/302/testdata/2.in Public input case 2 for problem 302.
algorithmic/problems/302/testdata/2.ans Placeholder answer file for case 2.
algorithmic/problems/302/testdata/3.in Public input case 3 for problem 302.
algorithmic/problems/302/testdata/3.ans Placeholder answer file for case 3.
algorithmic/problems/302/testdata/4.in Public input case 4 for problem 302.
algorithmic/problems/302/testdata/4.ans Placeholder answer file for case 4.
algorithmic/problems/302/testdata/5.in Public input case 5 for problem 302.
algorithmic/problems/302/testdata/5.ans Placeholder answer file for case 5.
algorithmic/problems/302/testdata/6.in Public input case 6 for problem 302.
algorithmic/problems/302/testdata/6.ans Placeholder answer file for case 6.
algorithmic/problems/302/testdata/7.in Public input case 7 for problem 302.
algorithmic/problems/302/testdata/7.ans Placeholder answer file for case 7.
algorithmic/problems/302/testdata/8.in Public input case 8 for problem 302.
algorithmic/problems/302/testdata/8.ans Placeholder answer file for case 8.
algorithmic/problems/302/testdata/9.in Public input case 9 for problem 302.
algorithmic/problems/302/testdata/9.ans Placeholder answer file for case 9.
algorithmic/problems/302/testdata/10.in Public input case 10 for problem 302.
algorithmic/problems/302/testdata/10.ans Placeholder answer file for case 10.
algorithmic/problems/303/chk.cc Checker for problem 303 (move sequence profit) scoring vs baseline (0 moves).
algorithmic/problems/303/config.yaml Runner limits and testcase count for problem 303.
algorithmic/problems/303/statement.txt Updated problem 303 statement + scoring definition.
algorithmic/problems/303/testdata/1.in Public input case 1 for problem 303.
algorithmic/problems/303/testdata/1.ans Placeholder answer file for case 1.
algorithmic/problems/303/testdata/2.in Public input case 2 for problem 303.
algorithmic/problems/303/testdata/2.ans Placeholder answer file for case 2.
algorithmic/problems/303/testdata/3.in Public input case 3 for problem 303.
algorithmic/problems/303/testdata/3.ans Placeholder answer file for case 3.
algorithmic/problems/303/testdata/4.in Public input case 4 for problem 303.
algorithmic/problems/303/testdata/4.ans Placeholder answer file for case 4.
algorithmic/problems/303/testdata/5.in Public input case 5 for problem 303.
algorithmic/problems/303/testdata/5.ans Placeholder answer file for case 5.
algorithmic/problems/303/testdata/6.in Public input case 6 for problem 303.
algorithmic/problems/303/testdata/6.ans Placeholder answer file for case 6.
algorithmic/problems/303/testdata/7.in Public input case 7 for problem 303.
algorithmic/problems/303/testdata/7.ans Placeholder answer file for case 7.
algorithmic/problems/303/testdata/8.in Public input case 8 for problem 303.
algorithmic/problems/303/testdata/8.ans Placeholder answer file for case 8.
algorithmic/problems/304/chk.cc Checker for problem 304 (walk visiting all vertices) scoring vs baseline walk.
algorithmic/problems/304/config.yaml Runner limits and testcase count for problem 304.
algorithmic/problems/304/statement.txt Updated problem 304 statement + scoring definition.
algorithmic/problems/304/testdata/1.in Public input case 1 for problem 304.
algorithmic/problems/304/testdata/1.ans Placeholder answer file for case 1.
algorithmic/problems/304/testdata/2.in Public input case 2 for problem 304.
algorithmic/problems/304/testdata/2.ans Placeholder answer file for case 2.
algorithmic/problems/304/testdata/3.in Public input case 3 for problem 304.
algorithmic/problems/304/testdata/3.ans Placeholder answer file for case 3.
algorithmic/problems/304/testdata/4.in Public input case 4 for problem 304.
algorithmic/problems/304/testdata/4.ans Placeholder answer file for case 4.
algorithmic/problems/304/testdata/5.in Public input case 5 for problem 304.
algorithmic/problems/304/testdata/5.ans Placeholder answer file for case 5.
algorithmic/problems/304/testdata/6.in Public input case 6 for problem 304.
algorithmic/problems/304/testdata/6.ans Placeholder answer file for case 6.
algorithmic/problems/304/testdata/7.in Public input case 7 for problem 304.
algorithmic/problems/304/testdata/7.ans Placeholder answer file for case 7.
algorithmic/problems/304/testdata/8.in Public input case 8 for problem 304.
algorithmic/problems/304/testdata/8.ans Placeholder answer file for case 8.
algorithmic/problems/304/testdata/9.in Public input case 9 for problem 304.
algorithmic/problems/304/testdata/9.ans Placeholder answer file for case 9.
algorithmic/problems/304/testdata/10.in Public input case 10 for problem 304.
algorithmic/problems/304/testdata/10.ans Placeholder answer file for case 10.
algorithmic/problems/305/chk.cc Checker for problem 305 (cascade flips on tree) scoring vs baseline BFS schedule.
algorithmic/problems/305/config.yaml Runner limits and testcase count for problem 305.
algorithmic/problems/305/statement.txt Updated problem 305 statement + scoring definition.
algorithmic/problems/305/testdata/1.in Public input case 1 for problem 305.
algorithmic/problems/305/testdata/1.ans Placeholder answer file for case 1.
algorithmic/problems/305/testdata/2.in Public input case 2 for problem 305.
algorithmic/problems/305/testdata/2.ans Placeholder answer file for case 2.
algorithmic/problems/305/testdata/3.in Public input case 3 for problem 305.
algorithmic/problems/305/testdata/3.ans Placeholder answer file for case 3.
algorithmic/problems/305/testdata/4.in Public input case 4 for problem 305.
algorithmic/problems/305/testdata/4.ans Placeholder answer file for case 4.
algorithmic/problems/305/testdata/5.in Public input case 5 for problem 305.
algorithmic/problems/305/testdata/5.ans Placeholder answer file for case 5.
algorithmic/problems/305/testdata/6.in Public input case 6 for problem 305.
algorithmic/problems/305/testdata/6.ans Placeholder answer file for case 6.
algorithmic/problems/305/testdata/7.in Public input case 7 for problem 305.
algorithmic/problems/305/testdata/7.ans Placeholder answer file for case 7.
algorithmic/problems/305/testdata/8.in Public input case 8 for problem 305.
algorithmic/problems/305/testdata/8.ans Placeholder answer file for case 8.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread algorithmic/problems/305/statement.txt Outdated
Comment on lines +90 to +95
### Baseline schedule `C_base`
The baseline schedule is computed deterministically as:
1. Root the tree at vertex `1`.
2. Compute a BFS order from `1` (ties broken by smaller vertex id).
3. Use that BFS order as the baseline schedule.

Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statement specifies the baseline BFS order uses “ties broken by smaller vertex id”, but the checker’s baselineBfsOrder is a standard queue BFS with sorted adjacency, which doesn’t guarantee smallest-id ordering among all vertices at the same depth. Please align the statement with the implemented tie-breaking, or update the checker to match the statement.

Copilot uses AI. Check for mistakes.
Comment thread algorithmic/problems/303/chk.cc
Comment on lines +27 to +55
// Allow completely empty output => interpret as 0 moves.
int S = 0;
if (!ouf.eof()) {
S = ouf.readInt();
} else {
S = 0;
}

if (S < 0) quitf(_wa, "S is negative: %d", S);
if (S > L) quitf(_wa, "Too many moves: S=%d > L=%d", S, L);

vector<char> touched(N + 1, 0);
long long collected = 0;
auto touch = [&](int i) {
if (!touched[i]) {
touched[i] = 1;
collected += w[i];
}
};

touch(a);
touch(b);

int p = a, q = b; // previous pair (unordered conceptually)

for (int t = 1; t <= S; t++) {
int u = ouf.readInt();
int v = ouf.readInt();

Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Participant output is parsed with ouf.readInt() for S, u, and v. Non-integer tokens or missing values will follow testlib's PE/WA exit paths rather than the intended quitp(0.0, ...) (0 score) behavior for infeasible outputs. Consider reading tokens manually (as in problem 305) and calling quitp(0.0, ...) on any parse/range failure.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore

Comment on lines +121 to +131
// Read participant output: exactly K integers.
vector<int> moves;
moves.reserve(K);

for (int t = 1; t <= K; t++) {
if (ouf.seekEof()) {
quitp(0.0, "Output has fewer than K=%d integers", K);
}
int x = ouf.readInt(1, N, format("x[%d]", t));
moves.push_back(x);
}
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Participant output is parsed with ouf.readInt(1, N, ...). If a token is non-integer (or other parse issues), testlib will terminate with PE/WA instead of awarding 0 score as required by the statement for infeasible outputs. To keep invalid outputs scoring 0, parse tokens manually (or otherwise catch parse failures) and always exit via quitp(0.0, ...) on any format/range error.

Copilot uses AI. Check for mistakes.
Comment thread algorithmic/problems/304/statement.txt Outdated
Comment on lines +74 to +81

1. Build a BFS tree rooted at `1` (ties broken by smaller vertex id).
2. Perform a deterministic DFS traversal of that tree (children in increasing id order), producing an Euler walk that:
- starts at `1`,
- traverses each tree edge down and back up once,
- has length exactly `2·(N-1)` and visits all vertices.
3. If this uses fewer than `K` moves, append additional moves by repeatedly traversing the smallest-id edge incident to vertex `1` back and forth until reaching exactly `K` moves.

Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statement says the baseline BFS uses “ties broken by smaller vertex id”. The checker’s baseline builds the BFS tree using a normal queue and iterating each adjacency list in increasing order, which does not guarantee global smallest-id tie-breaking among vertices at the same distance. Please either (a) adjust the statement to describe the implemented deterministic BFS (queue BFS with sorted adjacency), or (b) change the baseline construction to actually enforce the stated tie-break rule.

Copilot uses AI. Check for mistakes.
@joyemang33 joyemang33 merged commit e9bbb46 into FrontierCS:main Apr 20, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants