DOJ logoDOJ
Problems
Recently added problemsSaved problemsWorkbooks
CategoriesDLCContestsGroupsTeamsBoard
Ranking
Solved Problem RankingStreak rankingDOJ Power ranking
Status
Call for TasksLoginRegister
DOJ logoDOJ

Community online judge with OI-style subtask scoring, Elo ratings, and Discord account linking.

Problems
ProblemsCategories
Community
ContestsRankingBoardNoticesHost an external contestGuide
Account
LoginRegisterJudge Status
Policy
Terms of ServiceDLC RulesPrivacyAPI documentationLanguage runtimesContest rank rewardsRating and performance
© 2026 DOJ
All rights reserved
Editorial

Tromino Game

Back to problem

Editorial

For an even number of cells, codex responds with the cell obtained by rotating the previous red move by 180180180 degrees. There is no fixed cell, so this is always legal. Rotation then pairs every all-red placement with an all-blue placement, giving a tie. If one dimension is 111, pair consecutive cells (1,2),(3,4),…(1,2),(3,4),\ldots(1,2),(3,4),…, leaving the last cell unpaired for odd length. codex takes the mate of the previous move if it is uncolored, and any uncolored cell otherwise. Every pair ends with at least one blue cell. Every consecutive triple contains a complete pair, so no red tromino exists. codex wins. Otherwise both dimensions are odd and at least 333. coxld first takes the center, then responds by 180180180-degree rotation. Placements avoiding the center cancel in red-blue pairs. Among the four neighbors of the center, opposite cells have opposite colors. Exactly two neighbors are red, and they lie in perpendicular directions from the center. Together with the red center they form a red L tromino. Thus coxld wins strictly. Subtask 1 uses ternary board states and minimax. With KKK placements, it takes O(3RC(RC+K))O(3^{RC}(RC+K))O(3RC(RC+K)) time and O(3RC+K)O(3^{RC}+K)O(3RC+K) memory. The full solution takes O(1)O(1)O(1) time and auxiliary space per case. There are at most 6RC≤6⋅1066RC\le6\cdot10^66RC≤6⋅106 placements; compute area products in signed 64-bit arithmetic. Solution written by GPT6.1