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
Solving the Two Sum Problem in Python
Problem Statement
Given an array of integers, find two distinct indices such that the corresponding elements sum to a specified target value. Each input is guaranteed to have exactly one solution, and elements cannot be reused.
Example: For input array [2, 7, 11, 15] and target 9, return [0, 1] since 2 + 7 = 9.
Solution Approach
A brute-force s ...
Posted on Thu, 11 Jun 2026 18:03:52 +0000 by Helljumper
Simple Graph Theory and Construction
Simple Graph Theory and Construction
A
Consider vertices with weight 2 as adding one to vertices with weight 1. Thus the problem is split into two parts: constructing the tree and adding one to vertices.
In the first part, constructing the tree as balanced as possible is beneficial, as will be shown in the second step.
Construction:
Process DFS ...
Posted on Sun, 31 May 2026 16:28:06 +0000 by twostars
Solutions for Codeforces Round 997 (Div. 2) Problems
Problem Link
Approach:
For this problem, we need to calculate the perimeter of a shape formed by moving right and up. The perimeter can be determined using the formula: ((steps_up + width) + (steps_right + width)) * 2. This accounts for the outer boundaries of the shape.
Solution Code:
#include <iostream>
using namespace std;
typedef lo ...
Posted on Tue, 19 May 2026 23:19:15 +0000 by MoombaDS
Codeforces Round 4 Challenges
Codeforces Round 4 Challenges
A-String Construction Challenge
Output several 'you' strings and fill the rest with arbitrary characters
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
signed main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,m;
cin ...
Posted on Sun, 10 May 2026 20:01:07 +0000 by signs
Editorial and Analysis for 2024 ICPC Network Preliminary Round 2
Competition Overview
The problem difficulty is generally estimated as F < A = J = I < L = G = E < C = K = H. The contest featured a mix of standard algorithms and optimization problems. Below is the detailed analysis and solution for each problem.
Problem F: Prefix Sum Threshold
Problem Statement:Given an initial score of 1500 and a sequence o ...
Posted on Thu, 07 May 2026 20:53:12 +0000 by EGNJohn
Comprehensive Solutions for AtCoder ABC 065
<div> <h3>Problem 1: Freshness Assessment</h3> <p><b>Objective:</b> Determine the condition of food consumed after a delay.</p> <p>You possess an item with <i>A</i> days of remaining shelf life. You intend to consume it after <i>B</i> days. Consuming food that is already ex ...
Posted on Thu, 07 May 2026 07:56:10 +0000 by phpvn.org