Bitwise AND Partition Counting: Analysis and Algorithm Implementation
Bitwise AND Partition Counting: Analysis and Algorithm Implementation
Problem Statement
Given (n) integers (a_1, a_2, \dots, a_n), randomly partition them into two non-empty groups. Calculate the number of partitions where the bitwise AND of the numbers in each group results in the same value.
Constraints: (1 \le n \le 60), (0 \le a_i < 2^{1 ...
Posted on Fri, 18 Sep 2026 16:27:46 +0000 by liamloveslearning
SMU Summer 2023 Programming Contest: Solutions
This document provides solutions for problems from the SMU Summer 2023 Contest, Round 6.
A. Burger Optimization
This problem involves maximizing profit from selling two types of burgers with different ingredients and prices, given a limited number of buns. The strategy is to iterate through all possible counts of the first burger type, up to th ...
Posted on Sat, 12 Sep 2026 16:45:31 +0000 by ccx004
Counting and Graph Theory Problem Solutions: Edge Inclusion-Exclusion and MST with Boruvka
Let's consider the calculation for the number of four-vertex subgraphs with at least x specific edges, denoted as f_x. Using the principle of inclusion-exclusion, the count of subgraphs with no edges at all is f_0 - f_1 + f_2 - f_3 + f_4 - f_5 + f_6. Meanwhile, the count of subgraphs with all six edges present is simply f_6. The difference we n ...
Posted on Fri, 21 Aug 2026 16:31:31 +0000 by Sfoot
Tree Coloring Problem Solution Using Fast Fourier Transform
This problem involves calculating valid colorings of a tree under certain constraints. The solution uses inclusion-exclution principle combined with polynomial multiplication via Number Theoretic Transform (NTT).
Basic Approach
We approach the problem by computing the complement: count arrangements where at least one node violates the coloring ...
Posted on Thu, 14 May 2026 08:51:57 +0000 by Kitara