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
2024 CAIP Undergraduate Division Programming Challenge Solution Overview
Overview of Selected Problems
The following section outlines the algorithmic approaches and C++ implementations for specific tasks encountered during the undergraduate category of the 2024 competition. Each problem addresses distinct computational challenges ranging from string manipulation to graph optimization.
Task 1: Character Compsoition V ...
Posted on Fri, 31 Jul 2026 16:27:01 +0000 by dotbands
Solutions for Codeforces Round 855 (Div. 3)
Problem A: Is It a Cat?
Givan a string and its length, output "YES" if the string satisfies the following conditions; otherwise, output "NO":
The string consists of exactly four segments.
Each segment contains only one letter (case-insensitive), in the exact sequence: 'm', 'e', 'o', 'w'.
There are t test cases.
Approach
Th ...
Posted on Mon, 27 Jul 2026 17:02:01 +0000 by mindrage00
Programming Competition Problem Solutions: ABC Contest Analysis
The problem involved a simulation where characters 'a', 'b', and 'c' each appeared exactly once. The initial misunderstanding of the problem statement led to multiple incorrect attempts. The key was recognizing that each character appeared only once, not at least once.
Problem E: Expected Value Calculation
To solve the expected value problem, w ...
Posted on Sat, 25 Jul 2026 16:10:04 +0000 by Bluelove
Efficient Algorithms for Dragon Slaying, Backpack Optimization, and Geometric Problems
Dragon Slayer Pathfinding with Binary Enumeration
Coordinate scaling converts decimal start/end points to integers for grid processing. Binary enumeration efficiently searches all possible wall removal combinations.
#include <iostream>
#include <vector>
#include <bitset>
using namespace std;
struct Barrier {
int x_start, ...
Posted on Fri, 24 Jul 2026 17:13:22 +0000 by chreez
Solutions for Codeforces Educational Round 162 Problems A to D
A. Moving Chips
A greedy approach is applicable. Chips can only move left to the nearest empty cell. Therefore, only the longest contiguous segment of 1s matters (denoted as s). The chips within this segment need to be consolidated. The minimal number of moves equals the number of 0s inside this segment.
#include <iostream>
#include <v ...
Posted on Fri, 24 Jul 2026 17:04:43 +0000 by jreed2132
Counting and Maximizing Product of Similar Substrings using Suffix Array and Disjoint Set Union
The annual "Phantom Pavilion Summer Wine Tasting Conference" features two events: tasting and a fun challenge. The tasting event awards the title of "Chief Taster," and the challenge event awards "Chief Hunter." Many wine tasters participate.
At the conference dinner, bartender Rainbow prepares n glasses of cocktai ...
Posted on Mon, 20 Jul 2026 17:12:27 +0000 by Seraph
Solutions to a Set of Algorithmic Challenges from an ACGO Ranking Contest
Six problems drawn from a competitive programming rating competition are analysed below. Every solution is accompanied by both C++ and Python implementations. Keep in mind that Python code may run slower and care should be taken with complexity constants.
Problem 1 – Output a Digit Different from the Product
Given two integers a and b, print an ...
Posted on Thu, 16 Jul 2026 16:13:10 +0000 by machiavelli1079
Solving Luogu High-Precision Arithmetic Problems with Java BigInteger
Java's standard library includes the BigInteger class, which simplifies handling arbitrary-precision inteegrs, eliminating the need to manually implement high-precision logic for basic arithmetic tasks.
P1303 A*B Problem
import java.math.BigInteger;
import java.util.Scanner;
public class MultiplyDemo {
public static void main(String[] args ...
Posted on Wed, 15 Jul 2026 17:30:08 +0000 by endlyss
Counting Identification Cards That Clear All Gates Using Interval Intersection
We have N identification cards, numbered from 1 to N, and M gates. The i-th gate can be passed by any card whose number lies in the inclusive range [L_i, R_i]. Find the number of cards that can pass through all M gates individually.
Input is given on standard input in the following format:
N M
L1 R1
L2 R2
...
LM RM
Print a single integer: the ...
Posted on Sun, 12 Jul 2026 17:26:46 +0000 by coldkill