AtCoder Beginner Contest 159: Complete Editorial and Solutions

A - The Number of Even Pairs Given (n) even numbers and (m) odd numbers, count the number of ways to choose two distinct numbers such that their sum is even. A sum is even only if both numbers have the same parity. The number of ways to pick two evens is (\binom{n}{2} = n(n-1)/2), and for two odds its (\binom{m}{2} = m(m-1)/2). The total is the ...

Posted on Sun, 19 Jul 2026 16:34:57 +0000 by mc2007

SMU Autumn 2023 Round 3 Div.1 Editorial

A. Find The Array To satisfy the condition that every element in array b is divisible by at least one of its neighbors, the number 1 is universally effective. Therfeore, we can replace certain elements of array a with 1. The second condition requires minimizing the variance between a and b. The optimal strategy is to compare the sum of elements ...

Posted on Fri, 05 Jun 2026 18:09:07 +0000 by someone2088