SMU Summer 2023 Contest Round 5 Solutions
A. Points in Segments
An approach with a time complextiy of $ \mathcal{O}(n \times m) $ works well for small data ranges. The idea is to mark each point within the given intervals and then count how many points are not marked.
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
ios::sync_with_stdio(f ...
Posted on Sat, 01 Aug 2026 16:53:59 +0000 by minus4
Priority Queues in the APL Programming Language
Priority Queues in the APL Programming Language
Introduction
The concept of priority queues is fundamental in computer science. A priority queue is an abstract data type where each element has an associated priority. Elements are served based on their priority, with higher-priority items being processed first. Priority queues are widely used in ...
Posted on Mon, 06 Jul 2026 17:22:42 +0000 by hiroshi_satori
Multi-Round Elimination Voting System Simulation
Problem Overview
In a competitive selection process, $n$ judges vote for $m$ available brands using a multi-round elimination system. The goal is to determine if a single brand can emerge as the winner or if the selection fails due to a tie in the final round.
Elimination Rules
The process follows these logic steps until a result is determined: ...
Posted on Mon, 22 Jun 2026 16:34:51 +0000 by oldtimer
Ad-hoc Training
Difficulty range [1, 10], where ≤ 5 is easy, 6 requires thinking for ≤ 30min, 7 is barely solvable (1h). 8 means it's unsolvable but seems not difficult. 9 is currently unsolvable but can be naturally derived from the solution. 10 is extremely difficult to understand even the solution.
Thinking time should be around [40, 80] min, not ≤ 30 min.
...
Posted on Sat, 20 Jun 2026 17:01:21 +0000 by philvia
Implementing the Non-Rotating Treap: Core Mechanics and Advanced Applications
The non-rotating Treap, commonly referred to as the FHQ-Treap, operates without the rotation mechanisms found in traditional Treaps or AVL trees. Its equilibrium is maintained exclusively through deterministic split and merge procedures, combined with randomly assigned priority values. This architecture inherently supports persistent data struc ...
Posted on Sat, 30 May 2026 17:32:50 +0000 by mgs019
Optimizing Sequence Merging with Dynamic Programming and Matrix Exponentiation Techniques
Problem Overview
The problem involves merging a sequence of stones where each stone has a weight. The goal is to merge consecutive stones within a sequence into a single stone with a weight equal to the sum of the merged stones, at a cost equal to that sum. The merging must result in a final number of stones between a given range [L, R], and th ...
Posted on Wed, 13 May 2026 02:50:15 +0000 by vaanil