You can use several words in query to find by all of them at the same time. In addition, if you are lucky search understands word forms and some synonyms. It supports search by title and author. Examples:

  • 305 — search for 305, most probably it will find blogs about the Round 305
  • andrew stankevich contests — search for words "andrew", "stankevich" and "contests" at the same time
  • user:mikemirzayanov title:testlib — search containing "testlib" in title by MikeMirzayanov
  • "vk cup" — use quotes to find phrase as is
  • title:educational — search in title

Results

1.

datastructure

Last visit:  5 years ago
Registered:  5 years ago
2.
By arthur_9548, history, 15 months ago, In English
Multidimensional Range Query Data Structures Hello, Codeforces! I'm Arthur Botelho ([user:arthur_9548,2025-01-19]), and this is my first blog. After reading [this blog](https://mirror.codeforces.com/blog/entry/64914) by [user:mouse_wireless,2025-01-19] and solving [this problem](https://mirror.codeforces.com/contest/372/problem/B), my perspective of multidimensionality changed. I decided to implement other multidimensional data structures and solve problems using them. Now, I wish to explain my understanding of this subject and my implementations of these structures. I hope it will be useful or, at least, interesting. Summary ------------------ In this blog, we will discuss the general idea of Range Query Data Structures in one dimension and extrapolate the concepts to higher dimensions. We will also study implementations of multidimensional versions of these four structures: - Prefix/Partial/Cumulative Sum (Psum) - Disjoint Sparse Table (DiST) - Binary Indexed/Fenwick Tree (BIT) - Segment Tree (SegTree) The idea of the...
> //information on the operation and element type struct DataStructure{ //implementation of the DS, ```c++ template //information on the operation and element type struct DataStructure, void usage(){ DataStructure ds(size); //... //after structure is

Full text and comments »

  • Vote: I like it
  • +115
  • Vote: I do not like it

3.
By levonog, 6 years ago, In English
Algorithms repo on github Hi all! Several months ago I decided to write down all the algorithms I know (and don't know) in one Visual Studio project for reusing, remembering, preparing to the interviews and easy learning of new algorithms and compose them in the one big library. I have implemented some part of this library, but before going deeper I want to provide some examples of library current usages: <spoiler summary="Example"> For example, you can compute Fibonacci n-th element using matrix exponentiation by writing the following code: ~~~~~ #include <iostream> #include <Math/Math.h> using namespace std; int main() { algo::Matrix<int> mat{ {1, 1}, { 1, 0 } }; algo::Matrix<int> neutral{ {1, 0}, { 0, 1 } }; algo::Matrix<int> fib { {1, 1} }; mat = algo::bin_pow(mat, 7, neutral, algo::matrix_mul<int>); fib = algo::matrix_mul(fib, mat); cout << fib[0][0]; // prints 34 } ~~~~~ After this code compiles another file is generated that do not contain any of r...

Full text and comments »

  • Vote: I like it
  • +69
  • Vote: I do not like it

4.
By Mayank_Pushpjeet, history, 3 years ago, In English
Editorial For Educational round 143 (E: Explosions) The first thought we should get here is that, We will try to find the number of moves if we want to explode from ith index,and then we will take the minimum for all i from 1 to n. Now, for each index i we have to calculate the number of moves required in O(1) or O(log(n)). My solution deals with this in O(1) so I will explain that, Ideally before exploding at index i, what we have to do is to make the array strictly decrease from index i to n (except for the fact that we will not decrease any element beyond 0) and strictly increase from index 1 to i (here also we will not decrease any element beyond 0) because this will be the case when the chain reaction will eat all the elements. Now, since elements to the left of index i and to the right of index i are independent now , we will check for them separately. Now let us try to find the number of moves required to make the array increasing from index 1 to i. To do this in O(1): We want to know 2 indexes say i1 and ...
using stack datastructure for each index i, How? Suppose we want to calculate i2 for i so, a[i, We can find i2 using stack datastructure for each index i, How?

Full text and comments »

  • Vote: I like it
  • +4
  • Vote: I do not like it

5.
By cjtoribio, history, 8 years ago, In English
Venice Technique Motivation & Problem --- Recently saw [this](http://mirror.codeforces.com/problemset/problem/923/B) problem. For some this problem might seem like a segment tree problem and it is indeed one. However this problem and others where segment tree does not apply can be solved using another approach. I will rephrase the problem in a simpler way. We want a data structure capable of doing three main update-operations and some sort of query. The three modify operations are: **add**: Add an element to the set. **remove**: Remove an element from the set. **updateAll**: This one normally changes in this case subtract X from **ALL** the elements. For this technique it is completely required that the update is done to **ALL** the values in the set equally. And also for this problem in particular we may need one query: **getMin**: Give me the smallest number in the set. Observing this operations we want to handle, **SegmentTree** seems legit except for the remove, but we can wave it arou...

Full text and comments »

  • Vote: I like it
  • +80
  • Vote: I do not like it

6.
By madhur4127, history, 7 years ago, In English
Avoid silly overflow mistakes taking modulo in C++ TL;DR This article features `Modular` class which can be conviniently used for modular arithmetic more "naturally". #### Motivation Recent round featured an interesting problem [problem:1081C] (if you plan to solve it, read this later). Combinatoric solution requires you to calculate: $$ \displaystyle \binom{n-1}{k}m \left( m-1 \right) ^{k} \mod 998244353 $$ Many contestants failed pretest because of missing modulo operation somewhere in code. #### Solution Many contestants use functions like `add(ll a, ll b)` or `mul(ll a , ll b)` which makes implementation somewhat clumsy. I present you an alternate approach using `Modular` class. --- ~~~~~cpp template <int MOD=998'244'353> struct Modular { int value; static const int MOD_value = MOD; Modular(long long v = 0) { value = v % MOD; if (value < 0) value += MOD;} Modular(long long a, long long b) : value(0){ *this += a; *this /= b;} Modular& operator+=(Modular const& b) {value += b.value; if ...

Full text and comments »

  • Vote: I like it
  • +35
  • Vote: I do not like it

7.
By brebenel_mihnea, 3 years ago, In English
[Tutorial] Heavy-Light Decomposition Motivation problem ------------------ We aim to solve this problem: [Path Queries 2](https://cses.fi/problemset/task/2134). **Summary:** Given a tree with weighted nodes, you are asked to answer the following type of queries: `What is the maximum value on the path connecting nodes A and B ?` Definitions ------------------ - A **heavy child** of a node is the child with the largest subtree size rooted at the child - A **heavy edge** connects a node to its heavy child - A **light child** of a node is a child that it's not heavy - A **light edge** connects a node with a light child - A **heavy path** is a path made of heavy edges ![ ](/predownloaded/aa/3d/aa3d0d4a2fbcc6943b292cd5265b5ae3df5245ed.png) How it works ------------------ The main idea is to make use of the heavy paths in answering the queries, so we divide the path in heavy paths contained by it and then we add those heavy paths in a Segment Tree to support maximum-value query. - Any path from node $u$ t...

Full text and comments »

  • Vote: I like it
  • +60
  • Vote: I do not like it

8.
By nik_exists, 3 months ago, In English
Some reflections as a round setter v2 + How to set a round This blog post is inspired by [user:RobinFromTheHood,2026-01-19]'s [blog post](https://mirror.codeforces.com/blog/entry/134377). Creating Problems ------------------ After [contest:2185] ended, I received **many** questions about how to write a contest along with how the proposal process works, so I thought that I might write a blog post all about it. I'll be mentioning different problems I made throughout the round setting process, and copying from [this post](https://mirror.codeforces.com/blog/entry/135218), I'll be denoting final problems in bold, and I'll be denoting the $n$-th iteration of a problem by putting that many apostrophes after it: e.g A' is the first iteration of problem A, A'' is the second, and so on. Similarly, I won't go into detail about why a problem wasn't used. I started competitive programming on Codeforces in the summer of 2024, though I had dipped my toes into it with some in person competitions and Advent Of Code before then; even before that, I used to practice c...
entirety of the difficulty is based on whether you know a specific datastructure. Note that standard, the difficulty is based on whether you know a specific datastructure. Note that standard problems are

Full text and comments »

  • Vote: I like it
  • +90
  • Vote: I do not like it

9.
By TecTrixer, history, 2 years ago, In English
My approach to competitive programming in Rust # My approach to competitive programming in Rust Even though C++ is by far the most dominant competitive programming language today, Rust has become a viable alternative. I started using it for competitive programming a few months ago and I really like it. This is my take on using it for competitive programming, please feel free to ask questions in the comments or to add your own experiences. There are many aspects which make a language well suitable for competitive programming: ## 1. Support Without being supported by the biggest programming platforms such as [Codeforces](https://mirror.codeforces.com/), [AtCoder](https://atcoder.jp/) and [LeetCode](https://leetcode.com/) a language is mostly useless for competitive programming (this list is debatable ^^). It can still be used for platforms where you only submit the answer such as [Project Euler](https://projecteuler.net/) or [Advent of Code](https://adventofcode.com/). But I can speak from experience that it really sucks to wan...

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it

10.
By jeroenodb, 2 years ago, In English
12 Cool Geometry problems Cool and geometry in the same sentence? You must be mad! Well, no. I think there are lots of interesting geometry problems, only the average geometry problems people know happen to be implementation-heavy (and frankly not that cool) problems from ICPC contests. Here is a list to show off some actually cool problems. I included some problems to have some variation in the different kinds of problems on the list. The stars indicate approximate difficulty (not coolness per se). 1. ⭐⭐⭐⭐⭐[NCPC 2023 Interwined](https://open.kattis.com/contests/ncpc23open/problems/intertwined) For this problem there is unfortunately a solution with a complicated datastructure (decremental convex hulls). The coolness is from the fact that it can be solved with just normal convex hull algorithms. Can you figure it out? 2. ⭐⭐⭐★★ CEOI 2020 [problem:1402B]. I remember this problem fondly as CEOI was my first big onsite competition, and this was my first encounter with geometry problems (I couldn't solve it, b...
there is unfortunately a solution with a complicated datastructure (decremental convex hulls). The, ) For this problem there is unfortunately a solution with a complicated datastructure (decremental

Full text and comments »

  • Vote: I like it
  • +178
  • Vote: I do not like it

11.
By AlexSkidanov, 12 years ago, In English
MemSQL Start[c]UP 2.0 Round 1 and 2 Editorials Round1 ====== Problem B --------- The critical observation in this problem is that the points will be at the corners or very close to the corners. After that one simple solution would be to generate a set of all the points that are within 4 cells from some corner, and consider all quadruplets of points from that set. Problem C --------- When the magician reveals the card, he has $1 \over k$ chance to reveal the same exact card that you have chosen. With the remaining ${k-1} \over k$ chance he will reveal some other card. Since all the cards in all $m$ decks are equally likely to be in the $n$ cards that he uses to perform the trick, he is equally likely to reveal any card among the $n \times m - 1$ cards (-1 for the card that you have chosen, which we assume he has not revealed). There are only $m - 1$ cards that can be revealed that have the same value as the card you chose but are not the card you chose. Thus, the resulting probability is ${1 \over k} + {{k-1} \over k} \time...

Full text and comments »

  • Vote: I like it
  • +94
  • Vote: I do not like it

12.
By panda_2500, history, 3 years ago, In English
Biweekly contest 3 Editorial #### Note from Author: Congrats to all the Winners. Glad to see so much participation. Hope to see you all participate in the next biweekly as well. You can contact [user:panda_2500,2022-12-16] (Abhijit Mishra) or [user:adityagi02,2022-12-16] (Aditya Tyagi) for any queries related to the contest or problem discussion. I would recommend first looking at the hints for the problem if your facing logical issue, if you are absolutely clear with logic then move on to look at the solution and the code. Efforts will be made towards making code for other languages (Python) available as well. ## [A — Xeros](https://mirror.codeforces.com/gym/416532/problem/A) <br> <spoiler summary="Hint"> <spoiler summary="Hint 1"> Is there any reason we will interchange the same digits? </spoiler> <spoiler summary="Hint 2"> To make it in non-decreasing order the 1 should be before a 0 ? <br> 1 0 0 0 1 <br> is there any need for replacement in this? Which elements do you think should be repl...
There are 2 approaches to solve this problem. #### DataStructure, summary = "Solution"> There are 2 approaches to solve this problem. #### DataStructure approach We

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it

13.
By nilsilu95, history, 11 years ago, In English
Help BIT or Segment tree, print lexicographic kth smallest character ~~~~~ Given a string(S) of alphabets(lower case only,a-z) of length N<(10**6), do two kind of operations(total of M<(10**5): Type 1: 0 index c: Replace S[index] by char c. Type 2: 1 LeftLimit RightLimit K : Print the lexicographically Kth smallest character in the sub-string of String S starting from LeftLimit to RightLimit, inclusively.(The lexicographic order means that the words are arranged in a similar fashion as they are presumed to appear in a dictionary) Input format: The first line contains 2 space separated integers N and Q, denoting the length of the string and the number of operations respectively. The next line has a string S of length N. The next Q lines denote the update/print operations, where 0 and 1 denote the type of operation which has to happen. Output format: For each print operation, output the lexicographically Kth smallest character in the substring of S starting from LeftLimit to RightLimit if possible, else print "Out of range." (Without quote...
~~~~~ Which datastructure should be used?I think BIT or segment tree should be used,but how, Sample Output b a ~~~~~ Which datastructure should be used?I think BIT or segment tree should

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

14.
By ArPiT_PanDeY, history, 3 years ago, In English
Policy Based Datastructure in C++, ordered_multiset. Is this the correct way of implementing it? I saw this template somewhere for implementing ordered_multiset: ~~~~~ template <typename T> using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>; ~~~~~ But in this template, both find function and erase function are completely broken (when argument is not an iterator, but a key instead). So i was wondering what's the correct way of ensuring these functions work correctly, while keeping the interface feel "normal". I came up with something like this: ~~~~~ template <typename T> using oms = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T> class ordered_multiset : public oms<T> { public: oms<T>::iterator find(T k) { int order = this->order_of_key(k); return this->find_by_order(order); } template <typename U> void erase(U it) { //erases key where 'it' is pointing currently oms<T>::erase(it); } void ...
Policy Based Datastructure in C++, ordered_multiset. Is this the correct way of implementing it?

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it

15.
By Just_Zedan, history, 3 years ago, In English
Policy Based DataStructure im currently switching to mac and i can't use c++ Policy Based DataStructure it gave me "not found error" ---------------------------------- #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; ----------------------------------
Policy Based DataStructure

Full text and comments »

  • Vote: I like it
  • -19
  • Vote: I do not like it

16.
By Boshkash_Hates_CP, history, 17 months ago, In English
BST Problems Hello codeforces, as i have learned a new datastructure , i would like to solve some problems on it , so suggest some problems i can solve on binary search trees.
Hello codeforces, as i have learned a new datastructure , i would like to solve some problems on

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

17.
By pistone, 15 years ago, In English
datastructure problems in SGU problemset <p>hi everyone,<br />Is there any indicative list of datastructure related problems in SGU problem set,<br />specially&nbsp; &quot;TREES&quot; . <br /></p>
datastructure problems in SGU problemset, hi everyone, Is there any indicative list of datastructure related problems in SGU problem

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it

18.
By MrArM, 12 years ago, In English
How to learn HashTable DataStructure !? Hi , HappyNewYear ;) I saw some problem that need hashing to solve , Such as [problem:271D] and [problem:127D] . So I decided to learn this data structure ! I tried to find it by google but I can't find any intelligible tutorial . Can anyone help me with any helpful tutorial ?!
How to learn HashTable DataStructure !?

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it