Skip to main content
All Questions

Count the equal task splits in which Alpha wins, modulo 998244353.

Unlock detailed company stats for this questionUpgrade

A company maintains n x m tasks: departments 1..n and complexity levels 1..m, with exactly one task (d, c) per pair. Two managers, Alpha and Beta, split the tasks equally ((n x m)/2 each). A task (a, x) owned by Alpha can cover a Beta task (b, y) if at least one of these holds: (1) Central Office Advantage: a == 1, b != 1, x >= y; (2) Same Department Seniority: a == b, x > y; (3) Expert-Level Override: x == m, y < m, b != 1. Alpha wins if there is a one-to-one assignment from Beta's tasks to Alpha's tasks such that every assigned Alpha task covers its matched Beta task. Count the number of different equal splits where Alpha wins, modulo 998244353.

Format · Constraints: 1 <= n, m <= 500; m is even; n x m <= 20; n x m is even. Samples: (1,2) -> 1; (2,2) -> 2.

Community answers

No answers contributed by the community yet.

Related courses

Course

Machine Learning Engineer Interview Prep

Land your dream machine learning role at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates. Explore ML system design, core concepts, coding, behavioral interviews, and more.

Course

Behavioral Interviews: A Practical Guide for Engineers

Get offers at the level you deserve. Prep for senior+ behavioral interviews at FAANG and Tier-1 companies. Made with staff and principal engineers from Meta, Netflix, Google, and more. Avoid downleveling, elevate past projects, and stop sounding like a robot.