Можно ввести несколько слов — все они попадут в требования к поиску. Кроме того, осуществляется поиск по словоформам и, если повезет, по синонимам. Поддерживается поиск по названию, автору и специальный синтаксис запросов. Примеры:

  • 305 — ищет все посты, содержащие 305, найдет посты про Раунд 305
  • andrew stankevich contests — можно писать сразу много слов, будут искаться все
  • user:mikemirzayanov title:сазанка — ищет все посты в названии со словом "сазанка" авторства MikeMirzayanov
  • "vk cup" — можно использовать кавычку, чтобы искать точные совпадения
  • title:educational — искать в названии

Результаты

1.

Frame

Последнее посещение:  11 лет назад
Зарегистрирован:  11 лет назад
2.
Автор lotusblume, 15 месяцев назад, По-английски
Worst-Case Graphs for Maximum Flow Algorithms Maximum flow algorithms are known to perform significantly better in practice than their worst-case time complexities would suggest. So in this blog, I will present graphs on which the following maximum flow algorithms actually achieve their worst-case running time: | Algorithm | Time Complexity | | ----------------------- | ------------------------------ | | Ford-Fulkerson with DFS | $\mathcal{O}\big(m^2 \cdot U)$ | | Edmonds-Karp | $\mathcal{O}\big(n \cdot m^2\big)$ | | Dinic | $\mathcal{O}\big(n^2 \cdot m\big)$ | | DFS with Scaling | $\mathcal{O}\big(m^2 \cdot \log(U)\big)$ | | Dinic with Scaling | $\mathcal{O}\big(n \cdot m \cdot \log(U)\big)$ | | Most Improving Augmenting Paths | $\mathcal{O}\big(m \cdot \log(U) \cdot (m + n \cdot \log(n))\big)$ | | FIFO Preflow Push | $\mathcal{O}\big(n^3\big)$ | | Highest-Label Preflow Push | $\mathcal{O}\big(n^2 \cdot \sqrt{m}\big)$ | Here and in the rest of this blog: - $n =$ number of vertices, ...
$b$ frames. Each frame is an $a \times a$ grid. Within each frame, neighboring vertices are, )]. It consists of $b$ frames. Each frame is an $a \times a$ grid. Within each frame, neighboring

Полный текст и комментарии »

  • Проголосовать: нравится
  • +927
  • Проголосовать: не нравится

3.
Автор Fefer_Ivan, 13 лет назад, По-русски
New year update: Mashup contests Hello, Codeforces. **UPD: Mashup feature is disabled until the end of the round. This is temporary and won't happen in the future.** Today we want to present you with our latest feature: mashup contests. ![ ](http://assets.codeforces.com/images/eng_create_mashup_frame.png) ![ ](http://assets.codeforces.com/images/ded-moroz.jpg) &nbsp;[cut]&nbsp; Such frame is available for all Codeforces users at [Gym](/gyms) page, who took part in at least three official rated Codeforces Rounds. When you press [Create Mashup](/mashup/new) Contest button, you are redirected to (SUDDENLY :) mashup creation page. On this page you can enter contest name and duration and find problems via problem search form. <img style="width: 700px" src="http://assets.codeforces.com/images/eng_edit_mashup_frame.png"/> Problem search form support search by the number of parameters including: - Problem code with format (contest id)(problem index). For example, 123C. - Problem name in both Engl...
://assets.codeforces.com/images/ded-moroz.jpg) [cut] Such frame is available for all, Such frame is available for all Codeforces users at [Gym](/gyms) page, who took part in at least

Полный текст и комментарии »

  • Проголосовать: нравится
  • +431
  • Проголосовать: не нравится

4.
Автор ToxicPie9, 23 месяца назад, По-английски
It's almost 2025, why are you still choosing GCC 7 (32-bit)? This is my answer to https://codeforces.me/blog/entry/137484, in which [user:-is-this-fft-,2024-12-20] asked a bizarre question. This answer is too big for a comment so I made a blog post instead. ## The question The submission [submission:297353626] behaves normally with 180 MiB memory usage while [submission:297352244] got a runtime error due to stack overflow (with 256 MiB stack). Both submissions have identical code, don't seem to contain bugs, and an assertion exists to make sure the recursion is at most $2\times10^5$ layers deep. What's happening? ## TL;DR Notice that the solution with stack overflow uses GCC 7 (32-bit) while the accepted ones use GCC 13 (64-bit). This is not a coincidence. The main reason of unreasonable stack usage boils down to two points: GCC 7, and 32-bit. ## 32-bit First of all, the code is compiled and run in 32-bit mode. Compiling the submission with GCC 7.5 in 32-bit on [godbolt](https://godbolt.org/z/WT9WsdeW4) shows that the `lo...
`long long solve(long long, long long)` function has a gargantuan stack frame, seen from its prelude, , long long)` function has a gargantuan stack frame, seen from its prelude:

Полный текст и комментарии »

  • Проголосовать: нравится
  • +337
  • Проголосовать: не нравится

5.
Автор viktork, 12 лет назад, По-русски
ZeptoLab Code Rush 2014 <img src="http://assets.codeforces.com/images/zepto2014/image06.png" style="width:190px;float:right;margin:0 1em 1em 1em;"/> A coder can apply his breathtaking coding skills not only in different search engines but also in the mobile game industry. It is an option in Russia. If you do not believe &mdash; check this out: ZeptoLab company that created the world famous Cut the Rope game offers you the opportunity to see this for yourself. And yes, we are in Moscow. It's not a secret that those who strive to achieve top coding skills &mdash; work hard, including work on his self-education. Here in ZeptoLab we aim to create the area that strongly encourages self-development. Specifically, we have recently purchased a company library with everything necessary to get new knowledge, an improvised reading room with sofas and armchairs. <center> <img src="http://assets.codeforces.com/images/zepto2014/image08.jpg" style="width:400px;"/> </center> We also conduct developer's contest ...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +726
  • Проголосовать: не нравится

6.
Автор pwned, 4 года назад, По-английски
A purple's message to Mike (About Problem Coincidences) Dear [user:MikeMirzayanov,2023-02-12], Although you want the round to be rated, I, [user:pwned,2023-02-12], believe the contest should remain unrated. Making the round rated would be unfair. For instance, participants who blatantly copied the code for F would have a massive advantage. Problem F was worth a staggering 3250 points at the beginning of the round, outweighing the entirety of ABC! Meanwhile, participants who got the first four problems would have their positive delta stolen. At the extreme end, the users who focused on problem F, thinking it is simple, will have an even more pronounced disadvantage. Consider those who skipped D to look at F. These users hastily scribbled on their scratch papers, trying to find a swift solution. They would soon discover that they were attempting a 3100-rated monstrosity! Codeforces should not use an author's intentions to decide whether a round must be rated. Instead, we must view the situation from a participant's perspective. An un...
contests. Codeforces must ban users from creating posts and comments in the timeframe — such posts, in the time frame — such posts can wait for the competition to end. This way, we can preserve

Полный текст и комментарии »

  • Проголосовать: нравится
  • +395
  • Проголосовать: не нравится

7.
Автор gojira, 13 лет назад, По-русски
Codeforces Round #196 — Problems Analysis [problem:337A] -------------- First, let's sort the numbers `f[i]` in ascending order. Now assume that the smallest jigsaw puzzle which the teacher purchases consists of `f[k]` pieces. Obviously, she should buy the smallest `n` puzzles which are of size `f[k]` or greater to minimize the difference. These are the puzzles `f[k], f[k+1], ..., f[k+n-1]` (this is not correct when `f[i]` are not distinct and `f[k]=f[k-1]`, but such cases can be skipped). The difference between the greatest and the least size of the puzzles in such set is `f[k+n-1]-f[k]`. To choose the optimal `f[k]`, we can test every `k` between 1 and `m-n` and pick the one producing the least difference. The full algorithm is as follows: ~~~~~ read(n, m, f[1..m]) sort(f[1..m]) best = INFINITY for k = 1 to m-n best = min(best, f[k+n-1] - f[k]) print best ~~~~~ [cut] - [problem:337B] --------- Suppose that the width and height of the screen are `W` and `H` correspondingly. Since `W:H = a:b...
= a:b`, we have `H=W*b/a`. Similarly, the width and height of the film frame `w` and `h` are related as, In the first case (`a/b < c/d`) the stretching process ends when the frame reaches the same width, In the second case (`a/b > c/d`) the process ends when the frame reaches the same height as the, In the third case, the frame fills the screen entirely and the answer will be 0., `, we have `H=W*b/a`. Similarly, the width and height of the film frame `w` and `h` are related as `h

Полный текст и комментарии »

Разбор задач Codeforces Round 196 (Div. 2)
Разбор задач Codeforces Round 196 (Div. 1)
  • Проголосовать: нравится
  • +171
  • Проголосовать: не нравится

8.
Автор pinely, 3 года назад, По-русски
Pinely Round 2 Hey, Codeforces! Pinely is here! Just like every year, we are sponsoring the PTZ competitive programming camp. As a part of this, we have prepared a contest for the participants and invite everyone to join it on Codeforces. **[contest:1863]** is scheduled to start on [contest_time:1863]. During this round, you will have the opportunity to solve 9 problems within a time frame of 3 hours. The round will be rated for everyone. The problems have been authored and prepared by the Pinely team: [user:AndreySergunin,2023-08-26], [user:ch_egor,2023-08-26], [user:Endagorion,2023-08-26], [user:amethyst0,2023-08-26], [user:zeliboba,2023-08-26], [user:zemen,2023-08-26] along with our special friend [user:Golovanov399,2023-08-26]. We would like to express our special thanks to: * [user:bogocubic1,2023-08-29], [user:mana,2023-08-29], [user:PurpleCrayon,2023-08-29], [user:Silver_Fox,2023-08-29], [user:maomao90,2023-08-29], [user:qrewetka,2023-08-29], [user:Vladithur,2023-08-29], [u...
During this round, you will have the opportunity to solve 9 problems within a timeframe of 3 hours, ]. During this round, you will have the opportunity to solve 9 problems within a timeframe of 3 hours

Полный текст и комментарии »

  • Проголосовать: нравится
  • +472
  • Проголосовать: не нравится

9.
Автор Golovanov399, 5 лет назад, По-английски
A tool for testing interactive problems Hello, codeforces! I have created a tool for testing interactive problems. If you do not know what it is, I recommend you to read [Interactive Problems Guide](https://codeforces.me/blog/entry/45307) before/instead of reading this blog. It is important to understand that this tool does **not** help, in any way, to solve interactive (and all other types of) problems, where by "solve" I mean "come up with the solution". Today's June Lunchtime introduced an interactive problem called [XOR, The Detective](https://www.codechef.com/LTIME109A/problems/XORDETECTIVE), where I used my tool and it helped me to debug my solution, so I would like to use this chance to show the tool in work. With all of this out of the way, let's begin. Debugging interactive solutions in general ================== I can't say about everyone, but for me personally debugging a solution to an interactive problem is much harder than to a non-interactive one. First of all, basic testing on samples is already no...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +102
  • Проголосовать: не нравится

10.
Автор cry, 3 года назад, По-английски
CerealCodes Summer 2023 Programming Contest <center> Hello Codeforcers :3 </center> ================= **UPD 1: Opening ceremony on [Friday 7PM EST](https://www.timeanddate.com/worldclock/fixedtime.html?iso=20230811T190000&p1=179). Join our [Discord server](https://discord.gg/qve3dBA8Ek) for more information** **UPD 2: Contest has started! You may start your window anytime over the next 2 days. Join our [Discord server](https://discord.gg/qve3dBA8Ek) to ask clarifications for any problems. Good luck!** From the authors behind [contest:1852] and [contest:1853], CerealCodes is excited to announce our Summer 2023 Programming Contest! This contest will be held on August $13 - 15$ th with a customizable time-frame window. The time limit for novice is $3$ hours while intermediate and advanced are allowed $3.5$ hours. All of the contest information, including exact start and end times, can be found [here](https://www.cerealcodes.org/contestinfo). The competition has three divisions: Novice (USACO Bronze-Silver or Div....
Contest! This contest will be held on August $13 - 15$ th with a customizable time-frame window. The, within your time frame., This contest will be held on August $13 - 15$ th with a customizable time-frame window. The time

Полный текст и комментарии »

  • Проголосовать: нравится
  • +126
  • Проголосовать: не нравится

11.
Автор greateric, история, 5 месяцев назад, По-английски
Useless CP Information #7: How to Become an Assembly Bro (Assembly Tutorial Part 1) _If you were ever curious but were confused by the youtube tutorials. I'm going to try to make this as concise and useful as possible. Also, x86 is way easier to code in than ARM and if you disagree, you're wrong. And Intel syntax is better than AT&T syntax_ _This assumes you have a basic understanding of how pointers work in C_ First program & compiling ================== Make a file named `hello.s`: ~~~~~ .intel_syntax noprefix .section .rodata mystring: .ascii "Hello, World!\n" mystring_end: .section .text .globl main .type main, @function main: endbr64 push rbp mov rbp, rsp mov eax, 1 # write mov rdi, 1 # stdout lea rsi, mystring[rip] mov rdx, mystring_end - mystring syscall xor eax, eax leave ret ~~~~~ Compile and run with ~~~~~ $ gcc -o hello hello.s $ ./hello ~~~~~ In assembly, you are writing CPU instructions, so you only have access to low-level things: - Registers: the...
base of the current stack frame. `DWORD PTR [rbp-8]` means we're interpreting it as a double word (32, because we like to reference variables by their location relative to the base of the stackframe. For, functions or themselves? The answer is the stack: each function has its own stackframe. For example, other functions or themselves? The answer is the stack: each function has its own stackframe. For, **tack **p**ointer. The base pointer points to the beginning/base of the stack frame, while the stack, So, we're currently on the stack frame of `main()` and we're about to execute the instruction `call, ` makes `rbp` point to the beginning of the new stack frame, which is the current `rsp`. Note that the CPU, frame but it also points to `main`'s previous `rbp` value (see the figure above at `7ffe6570`). So

Полный текст и комментарии »

  • Проголосовать: нравится
  • +38
  • Проголосовать: не нравится

12.
Автор CristianoPenaldo, история, 4 года назад, По-английски
Rethink the Dijkstra algorithm -- Let's go deeper This is a blog for cp newbies (like me). For a long time I think the [Dijkstra algorithm (dij)](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) only has two usages: (1) Calculate the distance between vertices when the weights of edges are non-negative. (2) (Minimax) Given a path $p = x_1x_2...x_n$, define $f(p) := \max_{i=1}^{n-1}d(x_i, x_{i+1})$. Given source vertex $s$ and target vertex $t$, dij is able to calculate $min \\{f(p)|p\,\text{is a s-t path}\\}$. However, dij works for a function class, not only the sum/max functions. The sum/max functions are only the two most frequently used members of this function class, but the function class is far larger. Once the function $f$ satisfies several mandatory properties, you could use dij. The word "function class" is like an abstract class in C++: ~~~~~ struct f{ virtual bool induction_property() = 0; //bool: satisfy or not virtual bool extension_property() = 0; //bool: satisfy or not virtual bool dp...
vertex $u \notin T$ with the lowest $h$ value, if $h(u) > h(y)$, dij will not choose $u$ in thisframe., ; //frame number, In the induction step, the $d$ is correctly computed for every source vertex. In the $i$-thframe

Полный текст и комментарии »

  • Проголосовать: нравится
  • +156
  • Проголосовать: не нравится

13.
Автор dolphinigle, 13 лет назад, По-английски
MemSQL start[c]up Round 2 -- Editorial This is the Editorial for [contest:326] and [contest:335]. Congratulations [user:RAD,2013-08-05] for online round winner and [user:Petr,2013-08-05] for onsite and overall score winner! This editorial is written jointly by the contest's coordinators (i.e., MemSQL engineers). [problem:335A] -- [user:SkidanovAlex,2013-08-05] Reference solution: [user:nwin,2013-08-05]'s [submission:4222182] Instead of calculating the smallest possible number of sheets given a fixed $n$, let us instead try to compute the smallest possible value of $n$ given a fixed number of sheets. Let $k$ denote the number of sheets. If a particular letter appears $p$ times in $s$, then it must appear at least $ceil(p/k)$ times in the sheet. Thus we can compute the smallest possible value of $n$ by summing $ceil(p/k)$ over all letters. Now the original problem can be solved using binary search on $k$ (or brute force, since the constraints were small enough). [problem:335B] -- [user:SkidanovAlex,2013-08-...
frames. Look at this picture to better understand what we mean by square frame : ![ ](http, understand what we mean by square frame:, A possible $O(k^2)$ solution is similar, but makes checking whether or not the frame is filled much, Here we need to make a very important observation. If a square frame is contained within some other, Then, when we have these number precomputed, for every square frame $x1$, $y1$, $x2$, $y2$ we can, To find a frame, let’s sort all the points first by $x - y$, and then by $x$ (or $y$ -- both will, When we have a frame, we move to the third step, where we check if the frame is filled in. To do, With this observation made, we can only check if the last point on the stack forms aframe with the

Полный текст и комментарии »

Разбор задач MemSQL start[c]up Round 2
  • Проголосовать: нравится
  • +87
  • Проголосовать: не нравится

14.
Автор Zlobober, 10 лет назад, По-русски
Yandex.Algorithm 2017 We are announcing the annual Yandex.Algorithm 2017 championship! This is a great opportunity to compete with the strongest programmers of the world, win a fancy T-shirt, visit Yandex office or even receive some serious money prize. ![Yandex.Algorithm 2016!](http://codeforces.me/predownloaded/1b/c0/1bc02bc41cf4a9b3e823b5afa09136a9b5f50a24.jpg)<br /> [cut] <center><h3><a href="https://contest.yandex.com/algorithm2017/schedule/">Complete schedule</a></h3></center> In order to take place in the main part of the competition you must participate in at least one of the Warm-Up round ([April 22nd, 16:00 Moscow Time](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Yandex.Algorithm+2017+Warm-up+round&iso=20170422T16&p1=166&ah=1&am=40)) and Qualification round ([April 29nd or 30th, virtual participation](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Yandex.Algorithm+2017+Qualfication+round&iso=20170429T00&p1=166)) and solve at least one problem in some of them. ...
time frame for working on the problem. This round is equivalent to the remaining three elimination, frame for working on the problem. This round is equivalent to the remaining three elimination rounds

Полный текст и комментарии »

  • Проголосовать: нравится
  • +296
  • Проголосовать: не нравится

15.
Автор DanAlex, история, 11 лет назад, По-английски
Dare Please Some of you made the mistake of demanding an article on one of my favorite topics. (DP) ![ ](http://ericdye.it/wp-content/uploads/2015/03/Challenge-Accepted-Meme.jpg) _Note that the article might be simple for a big part of you as it is intended for the general public._ [cut]. ### Cutting to the chase As a young programmer, I heard about DP from contests. Searched it on Google. Urban Dictionary gave unsatisfying results. Then I searched for Dynamic Programming on Wiki and found that: _"dynamic programming is a method for solving a complex problem by breaking it down into a collection of simpler subproblems, solving each of those subproblems just once, and storing their solutions &mdash; ideally, using a memory-based data structure"_ Sounds pretty general, huh? Let's get there step by step. ### Lights, camera, action Breaking a problem into subproblems does not seem as obvious as there are many many ways to look at it. You can imagine this as **a setting** for ...
coordinates (x, y) at time stamp t. Now, having the representation of a single frame we have to bind, single frame we have to bind around the frames. We know Bilbo's directions in order $"SNESS"$ and his, #### Frame smart, , expand and frame smart on., Each "frame" transition has it's own way of change. For example a graph BFS traversal is like a

Полный текст и комментарии »

  • Проголосовать: нравится
  • +94
  • Проголосовать: не нравится

16.
Автор SuprDewd, 10 лет назад, По-английски
Solve problems for a chance at an interview with Google A couple of years ago Google launched an interesting website: [Google Foobar](https://www.google.com/foobar/). If you try to log in, you'll get an error saying: To login, you have to have logged in before. Confused? Search on... Pretty mysterious, right? Well, from what I read on Hacker News at the time, this is some kind of a puzzle set up by Google to recruit Python and Java developers. To get in, you'd simply have to search for the correct phrase. Someone reported that searching for "arraylist java" got him inside, but that didn't work for me. However, I recently found that searching for this actually gets you inside, but you have to be a little bit patient. Here's what you can do: 1. Open a browser of your choice (it has to be a sufficiently new version so you get the newest version of Google). I've only tested this successfully with Chrome and Firefox. 2. Go to [https://google.com/ncr](https://google.com/ncr). (The /ncr at the end is to make s...
easy and become progressively harder, and each problem has a certain time frame you have to solve, problem has a certain time frame you have to solve it within.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +207
  • Проголосовать: не нравится

17.
Автор willy108, история, 3 года назад, По-английски
Teamscode Spring 2024 Contest Official Editorial Sorry for the long wait. These problems were brought to you by [user:esomer,2024-04-05], [user:danx,2024-04-05], [user:dutin,2024-04-05], [user:jay_jayjay,2024-04-05], [user:oursaco,2024-04-05], [user:superhelen,2024-04-05], [user:thehunterjames,2024-04-05], [user:willy108,2024-04-05], and [user:yash_9a3b,2024-04-05]. Also, massive thanks to [user:omeganot,2024-04-05] for his [unofficial editorial](https://codeforces.me/blog/omeganot) (which was posted a lot sooner than ours). [Novice A/](https://codeforces.me/gym/105066/problem/A)[Advanced A: It's Time to Submit](https://codeforces.me/gym/105067/problem/A) ================== <spoiler summary="Solution"> Both "YES" and "NO" are consistent answer (as long as exactly one of them is the answer). If you print "YES" and get AC, you are getting AC by printing the sample output. If you print "NO" and get AC, you are getting AC by not printing the sample output. Never assume just because the carrot is big ... the sample out...
= \frac{a}{b} - \frac{a \text{ mod } b}{b}$ How can we frame the question in terms of ${n - i, How can we frame the question in terms of ${n - i} \text{ mod } {x}$?

Полный текст и комментарии »

Разбор задач Teamscode Spring 2024 (Novice Division)
  • Проголосовать: нравится
  • +42
  • Проголосовать: не нравится

18.
Автор ICPCNews, 3 года назад, По-английски
ICPC 2023 Online Challenge powered by Huawei <img src="/predownloaded/60/ed/60eddb18a54159e57dd1ffc836857f58420039bf.jpg" align="right" style="height: 280px;" alt="text"/> #### Hello, Codeforces! From the ICPC 2023 World Finals, we are happy to bring you an exciting online event: **The ICPC 2023 Online Challenge powered by Huawei**,which will start on November 20, 2023 15:00 UTC (UTC+8) In this Challenge, you will have a unique chance: - to **compete with top programmers globally** - to **solve 1 exciting problem** prepared by Huawei - to **win amazing prizes** from Huawei! **It is an individual competition.** #### The ICPC 2023 Online Challenge powered by Huawei: **Start:** [November 20, 2023 15:00 (UTC+8)](https://www.timeanddate.com/worldclock/fixedtime.html?day=20&month=11&year=2023&hour=10&min=0&sec=0&p1=166) **Finish:** [December 4, 2023 15:00 (UTC+8)](https://www.timeanddate.com/worldclock/fixedtime.html?day=04&month=12&year=2023&hour=10&min=0&sec=0&p1=166) **We hope you'll enjoy this ...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +387
  • Проголосовать: не нравится

19.
Автор dalex, 15 лет назад, По-русски
Codeforces Beta Round 76 - Analysis <p>At first I tell about the contest at all.<br></p>My problems in the contest were A-div2,&nbsp; B-div2,&nbsp; C-div2/A-div1,&nbsp; E-div2/C-div1,&nbsp; D-div1. I wanted to make only div.2 round, but then we decided to give you seven problems at both divisions. <a class="rated-user user-admin" href="../../../profile/MikeMirzayanov" title="Штаб, MikeMirzayanov">MikeMirzayanov</a> prepared the problem about milk pouring and <a class="rated-user user-orange" href="../../../profile/anonymous" title="Майор anonymous">anonymous</a> gave E-div1 problem. Also <a class="rated-user user-admin" href="../../../profile/RAD" title="Штаб, RAD">RAD</a> gave some advices to complicate problems Azembler and Flags a bit.<br><p>And now let's start analysis.<br><br><br><b>Problem A (div.2) - Restoring Password</b><br><br>Password was very easy to restore. You should just iterate over groups of 10 characters in the first string and over all codes. Then, if some number's code is equal to the group - print t...

Полный текст и комментарии »

Разбор задач Codeforces Beta Round 76 (Div. 2 Only)
  • Проголосовать: нравится
  • +26
  • Проголосовать: не нравится

20.
Автор NBAH, история, 10 лет назад, По-русски
Codeforces Round #367 (Editorial) **A** ------------------ We know that time=distance/speed. For each car we should find $time_i$, than if it is less than answer we should update it. Time Complexity: **O(n)**. [Solution](http://pastie.org/10935013) **B** ------------------ Consider $c[x]$ the number of stores in which the price per drink is $x$. We calculate this array prefix sum. Then the following options: 1) If the current amount of money $m$ is larger than the size of the array with the prefix sums than answer is $n$. 2) Otherwise, the answer is $c[m]$. Time Complexity: **O(n+q)**. [Solution](http://pastie.org/10935012) **C** ------------------ We will solve the problem with the help of dynamic programming. $dp[i][j]$ is the minimum amount of energy that should be spent to make first $i$ strings sorted in lexicographical order and $i$-th of them will be reversed if $j$ = 1 and not reversed if $j$ = 0. $dp[i][j]$ is updated by $dp[i-1][0]$ and $dp[i-1][1]$. It remains to verify that t...
** ------------------ Let's surround the matrix with the frame of elements. In each element of the matrix, and, **E** ------------------ Let's surround the matrix with the frame of elements. In each element of

Полный текст и комментарии »

Разбор задач Codeforces Round 367 (Div. 2)
  • Проголосовать: нравится
  • +37
  • Проголосовать: не нравится

21.
Автор VladiG, история, 8 месяцев назад, По-английски
Segment tree on Time First of all, this technique isn't anything new, it's a fairly known one, but I couldn't find any resources on this topic other than [this comment](https://codeforces.me/blog/entry/15296?#comment-203606) which is somewhat hard to find, so I decided to write a full blog. With that being said, let's begin with the blog. The problem ================== Lets consider the following problem: A graph is given with $N$ nodes and $Q$ queries. Each query is one of the following: - Add edge $(u,v)$ - Remove edge $(u,v)$ - Query the number of connected components in the graph The timeline ================== Lets imagine a timeline, from time $1$ to time $Q$, at each moment either some edge gets added, removed, or a query gets asked. Now the main idea of this technique is instead of dealing with deletions, for each edge we determine some intervals during which it exists. Namely if edge $(u, v)$ gets added at time $A$ and then later removed at time $B$ then that edge will ob...
later removed at time $B$ then that edge will obviously exist in the time frame $[A, B)$., obviously exist in the time frame $[A, B)$. The Segment Tree on time ================== Now

Полный текст и комментарии »

  • Проголосовать: нравится
  • +121
  • Проголосовать: не нравится

22.
Автор Nerevar, 13 лет назад, По-русски
Codeforces Round #217 (Div. 2): tutorial ### [problem:370A] There are two approaches to this task. The first is use BFS to find the shortest path three times. The second is to notice that: * A rook can reach the destination in one or two moves. If the starting and the destination fields are in the same row or column, one move is enough. * A bishop can reach only fields that are colored the same as the starting cell, and can do this in at most two moves: if the starting and the destination fields are on the same diagonal, one move is enough. To find this out, check that $r_1-c_1=r_2-c_2$ OR $r_1+c_1=r_2+c_2$. * A king should make $max(|r_1-r_2|, |c_1-c_2|)$ moves. ~~~ int r1, c1, r2, c2; cin >> r1 >> c1 >> r2 >> c2; if (r1 == r2 || c1 == c2) cout << 1; else cout << 2; cout << " "; if ((r1 + c1) % 2 != (r2 + c2) % 2) cout << 0; else { if (r1 + c1 == r2 + c2 || r1 - c1 == r2 - c2) cout << 1; else cout << 2; } cout << " "; cout << max(abs(r1 - r2), abs(c1 - c2)) << endl; ...
opposite sides each containing `w`. In opposite case frame can be shrinked. So the size offrame is, All you need is to write `frame_correct`. You may iterate through frame and check that all cells, Now we know the size of the required frame. How to find it’s leftmost-topmost corner?, The set of possible $x$s is: $minx, maxx-size+1$ and 0. Indeed, you may move frame to the left, frame can be shrinked. So the size of frame is $dx$ or $dy$, where $dx = maxx-minx+1$ and $dy=maxy

Полный текст и комментарии »

Разбор задач Codeforces Round 217 (Div. 2)
  • Проголосовать: нравится
  • +20
  • Проголосовать: не нравится

23.
Автор maroonrk, 8 месяцев назад, По-английски
AGC Proctoring Rules [Original Post on AtCoder](https://atcoder.jp/posts/agc_proctoring_en) **Starting with AGC077 on 3/29**, submitting a recording will be required in order to earn a **GP30 score**. For basic information about GP30 scores and AWTF2027, please refer to [this article](https://atcoder.jp/posts/1636). The detailed rules regarding recordings are as follows. ## Recording Requirements - Participants must record their **entire screen** during the contest. However, it is acceptable for part of the screen to be covered by a camera feed, as shown in the example below. Even in that case, be careful not to obscure important areas such as coding or program output. - If multiple monitors are used, all of them must be recorded. - However, if a tablet is used for notes or scratch work, recording it is not required. - No specific screen resolution is required, but the text must be legible. - The frame rate must be at least 10 FPS. - In addition to the screen recording, you must also ...
be legible. - The frame rate must be at least 10 FPS. - In addition to the screen recording, you, legible. - The frame rate must be at least 10 FPS. - In addition to the screen recording, you must also

Полный текст и комментарии »

  • Проголосовать: нравится
  • +117
  • Проголосовать: не нравится

24.
Автор mango_lassi, 5 лет назад, По-английски
EGOI 2021 ![ ](/predownloaded/02/07/02071a2e4be811b3a64060d654b65d653e7f2f46.jpg) The first ever European Girls Olympiad In Informatics (EGOI) is now over. You can view the scoreboard of the official contest on the [EGOI 2021 webpage](https://egoi.ch/en/results/). Congratulations to the medalists, and in particular to Alisa Gladchenko [user:AliceG,2021-06-19] and Ekaterina Shilyaeva [user:AlFlen,2021-06-19] for the top scores! We are also organising a virtual contest with the problems from the olympiad. The two contest days will be on codeforces. There is a **28-hour period** during which you can take the 5-hour contest. The first contest will open in a few hours and last until midnight on Saturday, and the second will last from the start of Sunday to early Monday morning. **All times are UTC+2!** Day 1: Friday 18.6. 20:00 &mdash; Saturday 19.6. 23:59 ([contest:103148]) Day 2: Sunday 20.6. 00:00 &mdash; Monday 21.6. 04:00 ([contest:103149]) Feel free to discuss the tasks here aft...
after the virtual contest frame ends. A big shout out to the [organisers and volunteers](https, Feel free to discuss the tasks here after the virtual contest frame ends.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +151
  • Проголосовать: не нравится

25.
Автор sahaun, история, 9 месяцев назад, По-английски
[Tutorial] Continuous Collision Detection in Video Games using Binary Search Hello Codeforces! [As promised almost three years ago](https://codeforces.me/blog/entry/116410#comment-1029354), I have finally found the time and scope to write about using CP techniques outside CP itself. My first post is about a **use case of binary search in video games**. Unfortunately, the post is written in MDX (with videos and custom elements that Codeforces doesn't support), so I have to post a link if you want to read the whole post. You can find it here: [Continuous Collision Detection in Video Games using Binary Search](https://sahaun.com/blog/continuous-collision-detection-in-video-games-using-binary-search/) Here is a summary. --- ### The Problem In a standard game loop, objects "teleport" from position $(x, y)$ to $(x + \Delta x, y + \Delta y)$ in a single frame. If a wall is thin enough, a fast-moving bullet can start on one side and end on the other in a single frame, completely skipping the collision check. This well-known bug is called _tunne...
single frame, completely skipping the collision check. This well-known bug is called _tunneling_., single frame. If a wall is thin enough, a fast-moving bullet can start on one side and end on the, )$ in a single frame.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

26.
Автор zloyplace35, 10 лет назад, По-русски
Codeforces Round #368 (Div.2) разбор Thanks all participants. I hope, you liked problems. A &mdash; Brain's photos We need to do exactly what is written in the task: to consider all of the characters, and, if there is at least one of the set ${C, M, Y}$ print "#Color" else &mdash; "#Black&White" B &mdash; Bakery Note that it makes no sense to choose the city for bakeries and the city with the warehouse so that had more than one way between them, as every road increases the distance over which you have to pay. So, the problem reduces to the following: select two neighboring cities so that one is a warehouse, and in the other & mdash; no. For doing this, simply iterate through all the city with the warehouse, among the neighbors of each town without looking for a warehouse and update the answer. If there is such a pair of cities, print -1. C &mdash; Pythagorean triples D &mdash; Persistence bookcase Solution №1: Note that the data is delivered all at once (offline). Then we can build a tree...
Let's go for a "frame" request and remember lamp garlands, which lies on the boundary. Then, in

Полный текст и комментарии »

Разбор задач Codeforces Round 368 (Div. 2)
  • Проголосовать: нравится
  • -2
  • Проголосовать: не нравится

27.
Автор geniucos, история, 10 лет назад, По-английски
Invitation to new OI style contest Info(1) Cup Hello everyone! I'm writing this entry to invite you all to take part in [the first edition of Info (1) Cup contest](http://info1cup.com/). It is an individual contest with algorithmic tasks and we will accept only C++ sources. The contest itself has 2 parts, both of which held online. **You can still take part in the online mirror in any frame of 5 hours before [time](https://www.timeanddate.com/countdown/generic?iso=20170412T15&p0=5121&msg=infO%281%29+Cup+International+Round+-+Online+Mirror+END&font=cursive&csz=1). We invite you all to participate. The tasks should be challenging for everyone The [live scoreboard](http://open.info1cup.com:8890/Ranking.html) of the online mirror is on.** PS: As in all the other contests that have online mirrors, I kindly ask you not to discuss the tasks until all the rounds and their online mirrors end. After that, on the official site, you'll find the editorials of the problems. The first one consists of a national contest in which only ...
can still take part in the online mirror in any frame of 5 hours before [time](https, in any 5-hours frame for a couple of days after the contest (usaco system). The official round will

Полный текст и комментарии »

  • Проголосовать: нравится
  • +116
  • Проголосовать: не нравится

28.
Автор oweMeEternity, 11 месяцев назад, По-английски
A Guide to Debugging Runtime Errors with Compiler Sanitizers We have all been there. You submit your solution, wait anxiously, and then see the dreaded Runtime Error on test 2. Is it an array out-of-bounds index? A signed integer overflow? A null pointer dereference? Usually, you have to stare at your code or add a dozen printf statements to find out. But there is a better way. ![ ](https://i.ibb.co.com/8g1j2NT9/Screenshot-2025-12-25-172753.jpg) ![ ](https://i.ibb.co.com/s9yBm35K/Screenshot-2025-12-25-16503f5.jpg) ![ ](https://i.ibb.co.com/ynHZFnPG/Screenshot-2025-12-25-165035.jpg) By using compiler sanitizers and debug flags, you can make your compiler tell you exactly which line caused the error and why. Here is how to set up a powerful debugging environment on both Linux and Windows. ### For Linux Users Linux makes this incredibly easy with GCC. Instead of your standard compilation command, use the following flags to catch errors at runtime. `g++ -g -O2 -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -D_GLIB...
-fsanitize=address -fno-omit-frame-pointer -D_GLIBCXX_DEBUG main.cpp -o main.out && timeout 10s, errors at runtime. `g++ -g -O2 -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer, -after-free, and stack-buffer-overflow. - **-fno-omit-frame-pointer:** Helps the sanitizer generate, -omit-frame-pointer -fno-sanitize-recover=all -D_GLIBCXX_DEBUG \ -fpch-instantiate-templates /c, ```bash clang++ -std=c++20 -g -O2 -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer

Полный текст и комментарии »

  • Проголосовать: нравится
  • +30
  • Проголосовать: не нравится

29.
Автор halyavin, 10 лет назад, По-английски
The case of slow printf and scanf I know what is the problem ================== _Where we are going we need all the courage we can get_ When I first read the comment that our shiny new gcc 6.2 C++14 compiler has slow printf and scanf I immediately knew what I would do the next weekend. The new MinGW switched to custom implementation and I didn't need anything else to tell what the problem is. _Of course_, their format string parsing is too slow, they copy data around countless times, no file buffering is used and they have enough levels of indirection to make finding the real code feeling like a treasure hunt. What else could be the problem after all? Keeping this thoughts in mind I patiently waited for a weekend. When I finally opened MinGW source and searched for printf function, I was pleasantly surprised. The real implementation was only a couple hops away and soon enough I was looking at the heart of printf code. MinGW did try to conceal it a bit though by naming it mingw_pformat.c. But a ~100Kb source fi...
(like end-of-file), create a SEH frame, take a lock, call _fputc_nolock, and release a lock in the SEH, write a symbol to a file? You check file stream for errors (like end-of-file), create a SEHframe, take

Полный текст и комментарии »

  • Проголосовать: нравится
  • +280
  • Проголосовать: не нравится

30.
Автор karock, 12 месяцев назад, По-английски
Coding Track NITSHACKS 8.0 Editorial Thank you everyone for participating!<br> Here's the <a href="https://codeforces.me/blog/entry/148539">Blog Link</a> and <a href="https://codeforces.me/contestInvitation/bf7862176fe66f9655deac0d350e142a848b624a">Contest Link</a> <br> <h3><a href="https://codeforces.me/gym/652259/problem/A">A. AntiDitto Arrays! </a></h3> <p>Idea and Prepared by: [user:itsiftikar02,2025-11-23]</p> <spoiler summary="Hint 1"> The final array will be the form of either $1010101...$ or $0101010...$ </spoiler> <spoiler summary="Hint 2"> $x^1 + x^2 + x^3 + ... + x^{n - 1} < x^n$ $\forall$ $x \ge 2$ </spoiler> <spoiler summary="Solution"> **Case $x = 1$:** we will calculate the cost for both $101010...$ and $010101...$. Then minimum of this cost will be the answer. **Case $x \ge 2$:** For other value of $x$, it will always optimal not to change the value of $a_n$. if $a_n = 1$ then the final array will be $.....0101$ and if $a_n = 0$ then the final array will be $.....1010$ </...
Now we can frame the solution as:

Полный текст и комментарии »

  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

31.
Автор geniucos, история, 9 лет назад, По-английски
InfO(1) Cup 2018 Hello everyone! I'm happy to invite you to take part in the [second edition of InfO(1) Cup](http://info1cup.com/), an online contest meant to be similar to international olympiads such as IOI, CEOI, BOI, APIO, etc. If you remember last year's entry about the contest, you should notice that we've been talking about making it an onsite event, but we decided it's both easier (especially financially) and helpful to more people (as we can have more online participants) to have it online. The contest consists of 2 rounds: the national round and the international round. Participation in both rounds is invitation based (you can see the "official" participants [here](http://info1cup.com/participants)). We've tried to reach out to the official organizers of Informatics Olympiad in several countries to make the competition as fierce as possible by having future IOI-participans, as well as to help those students in their training for upcoming international olympiads. Both rounds will ha...
choose any 4-hour frame to take it. It will end in 2 days and a half or so (better check the link

Полный текст и комментарии »

  • Проголосовать: нравится
  • +86
  • Проголосовать: не нравится

32.
Автор Wandoka, 2 года назад, По-английски
Catching bugs using C++ on Windows NOT in Visual Studio I am on Windows, I don't want to use WSL or Visual Studio. I want the compiler to tell me about stupid bugs. But I cannot figure out a way to do it. The problem: I cannot figure out a way to catch both of the bugs below: ~~~~~ #include<iostream> #include<vector> #include<set> using namespace std; int main() { //case 1 vector<int> V(5); cout << V[10] << endl; //case 2 set<int> Set; cout << *Set.begin(); } ~~~~~ Using clang ------------------ Clang allows me to use sanitizers on windows. I was not able to find a way to make them work in mingw. Here are my flags: <spoiler summary="clang flags"> `clang++ -g -O0 -std=c++17 -Wall -Wno-sign-compare -Wno-unused-const-variable -Wno-logical-op-parentheses -Wno-keyword-macro -Wfloat-equal -Wshadow -Wno-conversion -Wno-sign-conversion -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=undefined,address,float-divide-by-zero,float-cast-overflow` </spoiler> I can successfully catch...
-Wno-conversion -Wno-sign-conversion -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize, -frame-pointer -fno-optimize-sibling-calls -fsanitize=undefined,address,float-divide-by-zero,float-cast

Полный текст и комментарии »

  • Проголосовать: нравится
  • +32
  • Проголосовать: не нравится

33.
Автор ZhangShan, история, 4 месяца назад, По-английски
50 CSES problems with animated editorial and Scriba — a renderer for editorials with animations ! **TL;DR:** I built **[Scriba](https://scriba.judge.zone)** — a free, open-source (MIT) renderer that turns a LaTeX editorial (math, prose, tables, code, **and step-by-step algorithm animations**) into one self-contained, sanitized HTML file. Animations are driven by real code, not hand-drawn frames. To see it on real problems right now: **[50 CSES problems](https://app.judge.zone/problems?tags=cses) where every editorial is explained with an animation** — open any of them and press play. Or write your own in the [playground](https://scriba.judge.zone/playground), no signup. ## Hello, Codeforces! If you've ever written an editorial — for a school contest, a gym, or just a detailed solution comment — you know the drill. The prose and the math are the easy part. Then you hit *"and now the DP table fills up like this"*, and you're hand-drawing cells in `Excalidraw`, screenshotting each state into `step1.png`, `step2.png`, … Then you find an off-by-one in your own explanation, an...
changes — fix a bug, redraw every frame. - A GIF can't be paused mid-step, and readers can't step, its output — fix the logic once, every frame updates. - **Self-contained & sanitized:** math, - Screenshots go stale the moment the algorithm logic changes — fix a bug, redraw everyframe

Полный текст и комментарии »

  • Проголосовать: нравится
  • +24
  • Проголосовать: не нравится

34.
Автор Proof_by_QED, 8 месяцев назад, По-английски
Nebius Round 2 and Codeforces Round 1088 Editorial <spoiler summary="Rating Predictions"> | Predictor | A | B | C | D | E | F | G | H | |----------------------------------|-----|-----|-----|------|------|------|------|------| | [user:Proof_by_QED,2026-03-27] | 800 | 1300 | (1400-2000) | 1700 | 2100 | 2400 | 2600 | 3500| | [user:nifeshe,2026-03-27] | 800 | 1400 | (1400-1900) | 1800 | 2200 | 2600 | 3000 | 3500| | [user:dinohaur,2026-03-27] | 800 | 1200 | (1400-1700) | 2100 | 2300 | 2600 | 2900 | 3300 | | [user:_istil,2026-03-27] | 800 | 1200 | (1300-1800) | 1900 | 2300 | 2500 | 2800 | 3300 | | [user:Dragos,2026-03-27] | 800 | 1400 | (1400-1900) | 1800 | 2100 | 2400 | 2800 | 3500 | | [user:Argentum47,2026-03-27] | 800 | 1300 | (1400-2000) | 1900 | 2200 | 2500 | ? | ? | | [user:simplelife,2026-03-27] | 800 | 1200 | (1200-1800) | 1600 | 2000 | 2500 | 6700 | 6700 | | [user:AksLolCoding,2026-03-27] | 800 | 1000 | (1100-1800) | 1600 | 1900 | 2400 | ? | ? | | [user:nik_exists,2026-03-27]...
determining whether the answer is $\le 4$. A simple way to frame it is this: let $l$ be $\max(a, b, whether the answer is $\le 4$. A simple way to frame it is this: let $l$ be $\max(a, b)$ and $r$ be

Полный текст и комментарии »

  • Проголосовать: нравится
  • +48
  • Проголосовать: не нравится

35.
Автор fatalerror, история, 15 месяцев назад, По-английски
Python Optimization Tricks in Competitive Programming > For better reading experience in Chinese, please refer to: [LeetCode](https://leetcode.cn/discuss/post/3746464). # Preface This article introduces techniques to reduce runtime in competitive programming using Python, under the premise that the complexity remains **correct** and **unchanged**. Each technique is accompanied by a Speedup on CPython 3.11.5 / PyPy 3.10.13. # I/O ### Use fast input Replace the built-in `input` with `sys.stdin.readline`. Each `input()` call incurs prompt handling and a `sys.stdin` lookup, while `readline()` reads a line directly. The more input lines, the larger the gap. Speedup: CPython ~×4.2; PyPy ~×16.4. ~~~~~ import sys input = lambda: sys.stdin.readline().rstrip() # strip the trailing newline II = lambda: int(input()) LII = lambda: list(map(int, input().split())) ~~~~~ ### Read all input at once Use `sys.stdin.read().split()` to read everything into memory once, then consume as needed. This avoids calling the read fun...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +94
  • Проголосовать: не нравится

36.
Автор MikeMirzayanov, 12 лет назад, По-русски
ACM-ICPC World Finals 2014: Before Opening Ceremony Oh yes! Only a few days left before the Championship finals! The teams have already gathered in Yekaterinburg, most of them have registered and are watching a game between Russia and Belgium. I want to start from some history and remember that the tradition to publish travel notes about Saratov State University's trips to finals started back in 2005. The regular pattern is that almost every year when we made notes, our team won a medal. I won't try my luck, so here are some of the first impressions of this year. [cut] The Codeforces community knows this year's team very well, its members are: * [user:Gerald,2014-06-23] &mdash; Gerald Agapov, a person who coordinates Codeforces problems. He has been the key person collaborating with problem authors for Codeforces rounds since 2012. Oh yes, if something goes wrong with problems, he is the one I beaker at, but the guy is great and we hardly ever hae any problems :-) Gerald isn't only into programming. He loves maths, magnifi...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +247
  • Проголосовать: не нравится

37.
Автор JJCUBER, история, 12 месяцев назад, По-английски
Cost-Benefit Flow ## Motivation By chance, I stumbled upon the blog post by [user:errorgorn,2025-11-22] titled [Solving Problems with Min Cut Max Flow Duality](https://codeforces.me/blog/entry/136761). When they mentioned using flow (for certain problems) in a similar way to 2SAT, something clicked for me. While I knew how to solve a variety of flow problems along with forming certain flow networks ad hoc, there was this entire subset of flow problems which I previously did not understand how to do. The blog post does a great job of explaining many of the concepts/applications, but there were certain things that got black-boxed. In order to understand things, my brain works such that truly understanding what is going on under the hood (often through proofs) helps me better intuit how to use ~~and abuse~~ a tool. Naturally, I tried to search the internet for more information on this topic. Unfortunately, I quickly came to realize that not much material as in-depth as the aforementioned blog p...
from their frame of reference; what this means is that a cost of $k$ is the same as a benefit of $-k, represent one, we can represent the other by shifting our frame of reference., shifting our frame of reference such that $b$ no longer has any cost (or benefit). To do so, we, 1. If we have a cost, $x$, corresponding to $b$, this is the same as shifting ourframe of

Полный текст и комментарии »

  • Проголосовать: нравится
  • +94
  • Проголосовать: не нравится

38.
Автор Sawarnik, 5 лет назад, По-английски
Newton School Grand Coding Contest 2022 Editorial #### A. First Day at Newton School ------------------ <spoiler summary = "Solution"> ~~~~~ //C++ implementation #include <iostream> #include <string> using namespace std; int main () { string s; cin >> s; if (s == "Apple") cout << "Gravity"; else cout << "Space"; } ~~~~~ </spoiler> #### B. A Growing Rivalry ------------------ <spoiler summary = "Solution"> Let the number of rounds won by Nutan be $n$ and that won by Tusla be $t$. As $n + t = L$, we are given that $n + t$ is odd. Thus, we have $n \neq t$ as otherwise $n + t$ will be even. So we can see that there is no draw possible, one of Nutan or Tusla must have won more rounds than the other. To find whom, we first initialize $n = t = 0$. We will then iterate through each character of the string $S$. If the character is 'N', we increment $n$ by $1$, otherwise we increment $t$ by $1$. After we have finished iterating the string, if $n < t$ then Tusla has won, otherwise Tesla has won. You ca...
can frame this problem in another equivalent way., {i}$ or $0$ in each of the cells, we can frame this problem in another equivalent way. Problem

Полный текст и комментарии »

  • Проголосовать: нравится
  • +45
  • Проголосовать: не нравится

39.
Автор Ripatti, 15 лет назад, По-русски
Editorial for Codeforces Beta Round #93 <p><b>div2 A.</b> In this problem you should find length of polyline, multiply it by $k/50$ and output that you will recieve. Length of polyline is sum of lengths of its segments. You can calculate length of every segment using Pythagorean theorem: $d(A,B)=\sqrt{ (x_A - x_B)^2 + (y_A - y_B)^2 }$.<br />[cut]<br /><b>div2 B.</b> Idea of this problem was offered by [[user:RAD,2011-11-10]]. It was the last problem in the problemset and I had no any easy idea:) I thank him for it.<br /><br />Here you should calculate an array $cnt[100]$. $i$-th element of it stores number of sticks whose lengths equal $i$. Now you should calculate number of pairs of sticks of equal lengths. This number is $k = \sum_{i=1}^{100} [cnt[a]/2]$, where $[x]$ is floor of $x$. For every frame you need 2 if such pairs and <span class="short_text" lang="en"><span class="hps">you can choose it in any order</span></span>. Therefore the answer will be $z = [k/2]$.<br /><br /><b>div2 С. div1 A.</b> At the first you should...
= \sum_{i=1}^{100} [cnt[a]/2]$, where $[x]$ is floor of $x$. For every frame you need 2 if such pairs, is $k = \sum_{i=1}^{100} [cnt[a]/2]$, where $[x]$ is floor of $x$. For every frame you need 2 if such

Полный текст и комментарии »

Разбор задач Codeforces Beta Round 93 (Div. 2 Only)
  • Проголосовать: нравится
  • +40
  • Проголосовать: не нравится

40.
Автор uday, история, 8 месяцев назад, По-английски
Came up with a graph problem I can't solve: looking for ideas This is a problem I came up with while thinking about cycle-based optimization on graphs. I'm not sure if it's well-known or if I'm missing something obvious, either way I couldn't solve it, so I'd love to hear how more experienced people would approach it. --- ## Problem Statement You are given a directed graph with **N** nodes and **M** edges. It may have self-loops and multiple edges between the same pair of nodes. Each edge is described by three integers **u**, **v**, **w**: - you can move from node **u** to node **v** - the move takes exactly **1** unit of time - you gain **w** coins after using this edge You start at node **1** with **0** coins. You may traverse any edge any number of times and revisit nodes freely. **Find the minimum time to collect at least K coins. If it is impossible, print -1.** --- ## Examples ### Example 1 ``` Input: 5 6 24 1 2 6 2 1 6 1 3 0 3 4 8 4 5 8 5 3 7 Output: 4 ``` <spoiler summary="Explanation"> ...

Полный текст и комментарии »

  • Проголосовать: нравится
  • -13
  • Проголосовать: не нравится

41.
Автор WAtoAC2001, 3 года назад, По-английски
Invitation to LOCKOUT prelims 2024 (ANCC, IIT Delhi) Hello Codeforces! The Algorithms and Coding Club, IIT Delhi (ANCC) in collaboration with Tryst, IIT Delhi, will host LOCKOUT and would like to invite you all for the same. **Lockout** is a bracket tournament where contenders will solve CP problems to earn a higher score and secure their position in the next round. Participants will receive a set of problems to solve within a fixed time frame, with each problem carrying a set number of points. The first participant to solve a problem earns the points. Before the main event, a preliminary round will be held, and the **top 16** participants will advance to the tournament. **Lockout Prelims Details:**(Online) The Lockout Prelims will be hosted on the Codeforces platform. The contest will serve as an online preliminary round for an on-site final. It will be an ICPC style 2 hour long contest. The top 16 participants with the highest scores will proceed to the onsite tournament. - Date & Time : [3rd March 2024, 8-10 PM IST]...
within a fixed time frame, with each problem carrying a set number of points. The first participant to, frame, with each problem carrying a set number of points. The first participant to solve a problem

Полный текст и комментарии »

  • Проголосовать: нравится
  • +102
  • Проголосовать: не нравится

42.
Автор RobinFromTheHood, история, 2 года назад, По-английски
Some reflections as a round setter I was fortunate enough to have the opportunity to co-organize a div3 round [contest:2014] last week, and whilst my memory is fresh, I'd like to share some thoughts which might be of interest to future setters and users. The project started as a mere aspiration 6 months ago, when I contributed to [contest:1974]. It gave me some confidence to think about setting a round, and Robin Hood seemed like a fun theme to weave some legends around. Over the next months, I collected a few ideas and gathered enough courage to approach the div3 coordinator [user:Vladosiya,2024-09-26], who was surprisingly 'chill' about my obvious lack of experience and low rating. I enlisted [user:ChairmanFMao,2024-09-26] and [user:filikec,2024-09-26], and the round became a summer pastime for us. So, don't be put off by your rating or experience. If you come across nice ideas, discuss them, collect them, you might be the next contributor. Setting problems was quite straightforward with the polygon system. Lik...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +176
  • Проголосовать: не нравится

43.
Автор SummerSky, 9 лет назад, По-английски
Notes on Codeforces Beta Round #93 Div2-A, B, C, D, E, Div1-D [problem:127A] A straightforward implementation problem. Calculate the total distance and then the average time. [problem:127B] For each integer $i$, we denote its total number as $a[i]$. Note that only $a[i]/2$ (integer division) of them can be used to construct a frame. Thus, the total number of frames that can be built is $(\sum_i{a[i]/2})/2$. [problem:127C] This is also an implementation problem, but we should take care of the following issues: 1) several special cases like $t_0=t_1$ should not be omitted; 2) to find the pair $(y_1, y_2)$ so that the temperature is closet to $t_0$, it is better to use “integer computation” rather than “double computation”, since the latter one may meet some weird “precision trap”. [problem:127D] The problem can be solved based on the well known KMP algorithm. Specifically, we use the array $next[i]$ in KMP (one can find a lot of details about this on the Internet). At first, we check $next[n]$. If it is zero, it means...
division) of them can be used to construct a frame. Thus, the total number of frames that can be built is, ]$. Note that only $a[i]/2$ (integer division) of them can be used to construct aframe. Thus, the total

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

44.
Автор shivamg_isc, история, 8 лет назад, По-английски
Invitation to Alkhwarizm — 2019 by IIIT Allahabad ![ ](/predownloaded/f6/d2/f6d26a1098c5a527a8e9bd02992fa08d93bfde36.jpg) [Aparoksha](https://aparoksha.org/) is back with the flagship coding event &mdash; **Alkhwarizm** 2 years back, we launched the first ever [External Rated Contest](https://blog.codechef.com/2017/03/09/a-star-studded-rating-system/) on **Codechef** &mdash; [Alkhwarizm 2017](https://www.codechef.com/ALKH2017). Last year's [Alkhwarizm 2018](https://codeforces.me/blog/entry/58361) was a great success with over 1100 people participating in the contest. If you have the appetite for algorithmic problem solving, then don't miss it out! Contest link is here &mdash; [Alkhwarizm 2019](https://www.codechef.com/ALKH2019) It will be a **5 hour individual contest** with algorithmic problem-set of diverse nature, and is **open for both students as well as professionals.** The contest will comprise **10 problems**, and will be **rated for both divisions**. The prizes include cash prizes...
matrix exponentiation, compute DP in $O(Y^2)$ to **frame new transitions** for such row to obtain, obtained above from matrix exponentiation, compute DP in $O(Y^2)$ to **frame new transitions** for

Полный текст и комментарии »

  • Проголосовать: нравится
  • +85
  • Проголосовать: не нравится

45.
Автор NemanjaSo2005, история, 2 года назад, По-английски
My first cheating offer Hello codeforces, Today is the first time someone has come to my DMs asking to help them cheat. I am happy they see me as a good programmer, but sad that they want to cheat. To teach them a lesson and discourage others from cheating, I decided to make this blog exposing them. (And you also get to see me trolling them) At first, I wanted them to give me their CF password so that I could submit WA and then make a ton of wrong hacks, making their rating go down a lot. Maybe even make a blog on their account exposing them. Sadly, that didn't go well, so I just did some trolling. Also, I would like to warn you that some people might screenshot the DMs in an attempt to frame you. So message someone about you trolling a cheater before you do it. (I sent a message to my friend straight away) <spoiler summary="Messages"> ![ ](https://i.imgur.com/E2U7O1P.png) ![ ](https://i.imgur.com/NdXxLcO.png) ![ ](https://i.imgur.com/vwWaSpp.png) ![ ](https://i.imgur.com/rlmiy59.png) </spoil...
some people might screenshot the DMs in an attempt to frame you. So message someone about you, would like to warn you that some people might screenshot the DMs in an attempt toframe you. So

Полный текст и комментарии »

  • Проголосовать: нравится
  • +248
  • Проголосовать: не нравится

46.
Автор Nandansai08, 2 месяца назад, По-английски
Codeforces Cards — Turn Your Profile Into a Collectible Player Card # I Built a Ultimate Team-Style Card Generator for Codeforces Profiles **TL;DR:** [Codeforces Cards](https://nandansai08.github.io/cf-cards/) turns any CF handle into a collectible player card &mdash; OVR rating, six attributes, a rarity tier, playstyle badges, achievements and full rating history, all computed from your public Codeforces data. Nothing is random: the same handle always produces the same card. Open source, MIT licensed. --- ## Why I made this I'm a big fan of Ultimate Team-style card games &mdash; the OVR number, the attribute breakdown, the rarity tiers, the thrill of a pack opening. At the same time I spend a lot of my life staring at a Codeforces profile page that's just a rating number and a list of submissions. So I built the thing that lives in the overlap: take your actual contest history and render it the way a football game renders a striker's pace and finishing. ## What it does Enter a handle, and the app pulls your public Codeforces stats...
can be flipped, restyled (frame/background/theme — visuals only, never the stats) and exported, Cards can be flipped, restyled (frame/background/theme — visuals only, never the stats) and

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

47.
Автор Rynical, история, 5 месяцев назад, По-английски
Japanese part 4: Hiragana - H(B, P), Y, W, n ## The H Column Now let's learn the H-column. | A | I | U | E | O | | -- | -- | -- | -- | -- | | は | ひ | ふ | へ | ほ | | ha | hi | fu | he | ho | And yes, Japanese has decided to be weird again. Instead of: ```text ha hi hu he ho ``` we get: ```text ha hi fu he ho ``` The culprit this time is: ```text ふ = fu ``` Visual mnemonics: * は &mdash; Ha &mdash; Looks like **H** on **a**. * ひ &mdash; Hi &mdash; Looks like a smiling face laughing **hihihihihihi**. * ふ &mdash; Fu &mdash; Looks like Mount **Fuji**. * へ &mdash; He &mdash; Looks like an arrow pointing at **heaven**. * ほ &mdash; Ho &mdash; Looks like a flag on a **hotel**. There is one more thing worth mentioning. Remember when I said Japanese sometimes likes being weird? ```text は = ha へ = he ``` Most of the time. But when used as particles, they are pronounced: ```text は → wa へ → e ``` Don't worry about that for now. We'll learn particles later. Let'...
* わく — Frame / Boundary

Полный текст и комментарии »

  • Проголосовать: нравится
  • -27
  • Проголосовать: не нравится

48.
Автор andrewzta, история, 10 лет назад, По-русски
Russian Code Cup — Eliminataion Round, Some News Hi all! During Elimination Round of Russian Code Cup 2017 we had a technical issue that caused almost all problem A solutions sent for evaluation from 5-th to 10-th minute of the contest be accepted. We found that issue when it was already too late, so it wouldn't be fair to rejudge the solutions. However, we understand that this issue created unfair circumstances for other contestants, that could lose to those lucky ones that submitted in the described time frame. We have rejudged all solutions after the round, and tried to simulate how could the contest proceed should they have been judged correctly. Of course, any simulation of this kind cannot be accurate, and there is no completely fair resolution. We have decided to do the following: 1) Increase the number of Final Round participants to 55. It gives partial compensation to those participants who could have qualified but failed to do so because of someone's incorrectly small penalty. 2) Increase number of t-shirts t...
could lose to those lucky ones that submitted in the described time frame., , that could lose to those lucky ones that submitted in the described time frame . We have rejudged all

Полный текст и комментарии »

  • Проголосовать: нравится
  • +196
  • Проголосовать: не нравится

49.
Автор mnnit.prakharg, история, 11 месяцев назад, По-английски
OPC GoodBye 2025 Hello Everyone, The **Computer Coding Club** of MNNIT is thrilled to invite all students to participate in **OPC GoodBye 2025**, scheduled to take place on [Tuesday, December 30, 2025 at 9:00 PM IST](https://www.timeanddate.com/worldclock/fixedtime.html?day=30&month=12&year=2025&hour=18&min=30&sec=0&p1=166). #### Links - Join [CC club](https://codeforces.me/group/hUywLYmr80/) to be able to participate in the contest. - Registration form (MNNIT Students): [here](https://docs.google.com/forms/d/e/1FAIpQLSdRvcPSc9lJ2k6JiDqKAL0CgE4WnyDw7BW_qf-JuLfqEJ_73A/viewform?usp=publish-editor) - Contest Link: [here](https://codeforces.me/group/hUywLYmr80/contests) ![ ](https://i.ibb.co/whwGgWrP/final-opc-goodbye-logo.jpg) This event offers an exciting opportunity to immerse yourself in the realm of competitive programming, showcasing your skills while enjoying the thrill of a spirited competition. A big thanks to all setters and testers: me (Prakhar Garg) [user:mnnit.prakharg,2...
many problems as possible within the given time frame. Good luck, and happy coding!, problems as possible within the given time frame. Good luck, and happy coding

Полный текст и комментарии »

  • Проголосовать: нравится
  • +23
  • Проголосовать: не нравится

50.
Автор Manoj_mk, история, 16 месяцев назад, По-английски
When to Use Binary Search in Competitive Programming ## When to Use Binary Search in Competitive Programming Binary Search is one of the most powerful tools in a competitive programmer’s toolkit. While it’s classically taught for searching in sorted arrays, its real power lies in solving a wide variety of problems efficiently by reducing the search space. In this blog, we’ll cover **when and how to use binary search**, along with **problem types** where it's especially useful. --- ### Prerequisite You must know the basic binary search algorithm: ```cpp int low = 0, high = n-1; while (low <= high) { int mid = (low + high) / 2; if (condition) low = mid + 1; else high = mid - 1; } ``` --- ## When to Use Binary Search Binary search is applicable when: ### 1. The Answer Lies in a Monotonic Search Space If you can frame the problem such that the answer lies in a **monotonic function** (increasing or decreasing), then binary search can be used to "search the answer". **Examples**: * Mini...
Space If you can frame the problem such that the answer lies in a **monotonic function, If you can frame the problem such that the answer lies in a **monotonic function** (increasing or

Полный текст и комментарии »

  • Проголосовать: нравится
  • +9
  • Проголосовать: не нравится

51.
Автор yongwhan, 12 лет назад, По-английски
2015 Facebook Hacker Cup Round 1 ## **General Comment** I did not spend too much time on thinking about the execution time since the 6-minute is usually much more than the required in the usual online contest (e.g., 2 seconds for CodeForces for instance). So, for each problem, I took whichever way leading me to code reliably. Also, for each problem, I did lots of stress testing since I screwed up few contests (e.g., the large input in the previous Google Code Jam) before by not fully testing my codes with respect to the full constraint given by the problem. For A and C, I generated the edge cases manually and compared the computed answers from the brute force approaches and made sure they match. For B and D, I generated the theoretical worst case to make sure they are handled properly using my codes. Thankfully, I hit few segmentation fault problems 4-5 hours into the contest, from which I tried few approaches to increase the stack size; manipulating the size limit in `#include<sys/resource.h>` did the trick ...
code; I think it is roughly the optimal time frame, since I would like to chew on the problems a, the submission deadline to start submitting the code; I think it is roughly the optimal timeframe

Полный текст и комментарии »

  • Проголосовать: нравится
  • +47
  • Проголосовать: не нравится

52.
Автор Jamshed11, история, 3 года назад, По-английски
Invitation to Codelicious Hello Codeforces! ![ ](/predownloaded/f1/df/f1dfc33380205bf5075da54ea61cebedadf4d5a0.jpg) Craving for a coding challenge? Get ready because Pulzion Tech or Treat is throwing a feast full of Codelicious treats for you to dig your fangs into. I invite all of you to join and take part in Codelicious, the worldwide coding challenge featured in Pulzion Tech or Treat, the annual flagship event of PICT ACM Student Chapter. You will be served 6-8 problems in a time frame of 2 hours to solve and savor them. Special thanks to [user:yashss1,2023-10-25], [user:admiralpunk111,2023-10-25], [user:harshpatil2104,2023-10-25], [user:vijaymunde_02,2023-10-25], [user:Nachiket,2023-10-25], [user:adsulswapnil27,2023-10-25], [user:shreekargade2004,2023-10-25] for their valuable contribution. **Registrations:** **Only registrations via the website will be considered valid and will be eligible for the prizes.** To register, please refer to our website: [https://pulzion.co.in/](https://p...
event of PICT ACM Student Chapter. You will be served 6-8 problems in a time frame of 2 hours to, You will be served 6-8 problems in a time frame of 2 hours to solve and savor them.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +43
  • Проголосовать: не нравится

53.
Автор Jamshed11, 2 года назад, По-английски
Codelicious 2024 ![ ](/predownloaded/32/30/32308c28f771a7c12e86be537d5f980cd55d4a33.png) TextCraving for a coding challenge? Get ready because Pulzion '24 &mdash; Tech Across Ages is throwing a feast full of Codelicious treats for you to dig your fangs into. I invite all of you to join and take part in Codelicious, the worldwide coding challenge featured in Pulzion: Tech Across Ages, the annual flagship event of PICT ACM Student Chapter. You will be served 6-8 problems in a time frame of 2 hours to solve and savor them. Special thanks to [user:admiralpunk111,2024-09-28], [user:adsulswapnil27,2024-09-28], [user:prathameshkhanna,2024-09-28], [user:Lalit_Mohane,2024-09-28], [user:nah_man,2024-09-28], [user:tanay2245,2024-09-28] for their valuable contribution. **Registrations:** Only registrations via the website will be considered valid and will be eligible for the prizes. To register, please refer to our website: [https://pulzion.co.in](https://pulzion.co.in) **Contest Details:**...
event of PICT ACM Student Chapter. You will be served 6-8 problems in a time frame of 2 hours to, You will be served 6-8 problems in a time frame of 2 hours to solve and savor them.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

54.
Автор luosw, история, 6 лет назад, По-английски
CarYon — An OI/ACM Contest Test Case Generator based on C++ # CarYon: An OI/ACM Contest Test Data Generator based on C++ ![img](https://img.shields.io/badge/Avatar-luosw-red.svg) ![img](https://img.shields.io/github/package-json/v/luosiwei-cmd/caryon) ![img](https://img.shields.io/npm/dm/datamaker-caryon) ![img](https://img.shields.io/npm/dt/datamaker-caryon) ![img](https://img.shields.io/npm/l/datamaker-caryon) ![img](https://img.shields.io/npm/v/datamaker-caryon) # Front Have you ever encountered the following problems when holding a self-contained OI match: - Want to quickly produce a paragraph of text? - Want to quickly perform mathematical operations to generate data? - Want to generate test data one by one without using freopen? - Want to generate a set of random data or series? - Quickly generate data to match the two programs? Then, you can use CarYon and C++ to quickly generate data. Previously supported features are: - Randomly generate a chapter, some words, some words - Get out of the limitation of RAND_MA...
is created, so you don't have to worry about which frame is jumping and jumping!, worry about which frame is jumping and jumping! This is the working principle of the entire data

Полный текст и комментарии »

  • Проголосовать: нравится
  • +35
  • Проголосовать: не нравится

55.
Автор sushmit2022, история, 7 месяцев назад, По-английски
Editorial - Insomnia 2026 [A. The Oracle's Curse](https://codeforces.me/gym/682678/problem/A) ================== Author: [user:aditya1977,2026-04-27] <spoiler summary="Explanation"> <h3>Observation</h3> An alarm rings when a stock with a low starting price passes a stock with a high starting price. Since all stocks go up by exactly $1$ every day, a lower stock can only pass a higher stock if the higher one hits its maximum limit and stops growing. Once it passes, it stays ahead forever. Because the total number of alarms only goes up over time (it never goes back down), we can easily use <b>Binary Search</b>. In coding terms, when a smaller starting value overtakes a larger one, we call this an <b>inversion</b>. <hr> <h3>Definition</h3> Let $N$ be the number of stocks and $g$ be the target alarms. First, we sort all stocks by their starting prices $s_i$. Each stock is stored as a pair: $$ E_i = (s_i, u_i) $$ For any guessed day $D$, the new projected price $P_i$ of the $i$-th stock...
{new} = L - a + 1$$ We store these absolute coordinates so all queries share the sameframe of, } = L - a + 1$$ We store these absolute coordinates so all queries share the sameframe of

Полный текст и комментарии »

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится

56.
Автор MesbahTanvir, история, 8 лет назад, По-английски
Editorial [GYM] 2018 BACS Contest replay [problem:101864A] Setter: [user:ISwearItIsMyLastContest,2018-08-10] Alternate Writer: [user:prophet_ov_darkness,2018-08-10], [user:s_h_shahin,2018-08-10] <spoiler summary="Editorial"> This problem actually reflect the [josephus problem](https://en.wikipedia.org/wiki/Josephus_problem). The main part of this problem is to find Number of possible Y such that **josephus(Y,2) = X** . After finding this rest part is obvious calculation. Let’s see first few values of josephus(i,2): 1 1 3 1 3 5 7 1 3 5 7 9 11 13 15 We can see that there is a nice pattern here. **josephus(n,2)** is an increasing odd sequence that restarts with **josephus(n,2) = 1** whenever the index **n** is a power of 2. First we will find minimum value of p such that **josephus(p,2) = X**. we can do this in **O(log n)** , because for every **q>0** **josephus(2^q-1,2) = 2q^-1** and **josephus(2^q,2) = 1**. So we can run loop through q >= 0 and find highest value of **q** such that **josephus(2...
a better approach. We can do two binary searches for this. Let the time frame we are currently, better approach. We can do two binary searches for this. Let the time frame we are currently checking

Полный текст и комментарии »

Разбор задач 2018 BACS Contest Replay
  • Проголосовать: нравится
  • +38
  • Проголосовать: не нравится

57.
Автор Nourhan_Abo-Heba, история, 13 месяцев назад, По-английски
Recursion — Understanding with Stack Pictures & Examples Hi everyone! In this post I’ll try to make **recursion** clear using **stack intuition** and **ASCII trees** after each example. --- ## What is Recursion? A function can call another function. A function can also call **itself** — that’s recursion. Example: ```cpp void Print2() { cout << "NOUR"; } void Print() { Print2(); cout << "NOUR"; } int main() { Print(); } ``` Stack: ``` Push: main() → Print() → Print2() Pop: Print2() → Print() → main() ``` * `exit(0)` → terminates all stack frames immediately. * `return` → terminates only the current function. --- ## What if the function calls itself with no stop? ```cpp void Print() { Print(); cout << "NOUR"; } int main() { Print(); } ``` Stack: ``` Push: main() → Print() → Print() → Print() → … infinite Pop: never happens → program crashes (stack overflow) ``` We need a **base case** to stop recursion. --- ## Adding a base case `...

Полный текст и комментарии »

  • Проголосовать: нравится
  • -3
  • Проголосовать: не нравится

58.
Автор hmehta, история, 6 лет назад, По-английски
Topcoder Advanced Dynamic Programming Webinar and Practice Contest Hi All, Topcoder brings you another insightful webinar on Dynamic Programming hosted by our veteran competitor and problem coordinator <font color=red><b>[misof](http://topcoder.com/members/misof)<b></font>. If you are a beginner, you are encouraged to watch [Part 1](https://www.youtube.com/watch?v=vXNqIyXrVi4) before joining this session. The webinar will be followed by a 24-hour Advanced Dynamic Programming Practice Contest. [Register for the webinar now.](https://us02web.zoom.us/webinar/register/WN_aYpmMvM_TOul26FWEevxjA)  Attendance is limited to the first 500 participants. If you do not get a spot, we will also broadcast live on YouTube. Find it [here](https://www.youtube.com/channel/UCFv29ANLT2FQmtvS9DRixNA). The webinar will be followed by a practice contest to allow you to flex your nerves. Read [this tutorial](https://www.topcoder.com/thrive/articles/Dynamic%20Programming:%20From%20Novice%20to%20Advanced) and get ready. The contest will consist of 10 Topcoder Pr...
and will be open for 24 hours. You can submit whenever you feel like during the timeframe., feel like during the time frame. **Advanced Dynamic Programming Webinar**: [June 16, 2020

Полный текст и комментарии »

  • Проголосовать: нравится
  • +29
  • Проголосовать: не нравится

59.
Автор abner_vidal, история, 7 месяцев назад, По-английски
[Solution] CSES — Same Sum Subsets ## Introduction In this problem, we are asked to find two **disjoint subsets** of an array such that both subsets have the same sum. The key constraints are: - $3 \le n \le 40$ - $\sum_{i=1}^{n} x_i \le 2^{n} - 2$ After solving it on my own, I looked through several other submissions but couldn't find an approach similar to mine. I found my solution quite elegant, so I decided to share it here. --- ## Prerequisites - Pigeonhole Principle - Fast Fourier Transform (FFT) / Number Theoretic Transform (NTT) - Meet in the Middle --- ## Observation 1 It is sufficient to find two **distinct** subsets $A$ and $B$ (not necessarily disjoint) satisfying $\sum_{x \in A} x = \sum_{x \in B} x$. > **Intuition.** If $A$ and $B$ share elements, those elements contribute equally to both sums and can simply be cancelled out. What remains on each side is a pair of disjoint subsets with equal sum. **Proof.** Define $A' = A \setminus B$ and $B' = B \setminus A$. By constr...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +15
  • Проголосовать: не нравится

60.
Автор darkshadows, 11 лет назад, По-английски
[GYM] 2016 CodeCraft IIIT Hyderabad Tutorial ### [problem:100889A] Given an array of integers, find a permutation of the array to maximize the sum $\sum_{i=1}^{\frac{N}{2}} A_{n-i+1} - A_i$. If we observe the formula closely we see that we have to calculate $\sum_{i=1}^{\frac{N}{2}} A_{n-i+1} - \sum_{i=1}^{\frac{N}{2}} A_i = \sum_{i=\frac{N}{2} + 1}^{N} A_{i} - \sum_{i=1}^{\frac{N}{2}} A_i$. If the array is of odd length, we can simply skip the middle element. This can be maximized by putting the large numbers in the right half, and the small numbers in the left half. One good way to do this is to simply sort the array in ascending order. Complexity: $O(N \textrm{log} N)$. Code: http://ideone.com/nJddvt ### [problem:100889B] Given an array $A$, make it palindromic using minimum merging operations. In one merging operation two adjacent elements can be replaced by their sum. To make an array a palindromic we can simply apply merging operations $n-1$ times where $n$ is the size of array. In that case,si...
bottom corner of the destination rectangle in new coordinate frame. Let $e$,$f$ be its side lengths, the left bottom corner of the destination rectangle in new coordinate frame. Let $e$,$f$ be its side

Полный текст и комментарии »

Разбор задач 2016 CodeCraft IIIT Hyderabad Replay
  • Проголосовать: нравится
  • +41
  • Проголосовать: не нравится

61.
Автор Andreasyan, 17 месяцев назад, По-английски
Gandalf meets Saruman scene In recent times, the platform of Codeforces has been besieged by a tempest of indignation and discourse surrounding the topic of cheating. Yet amid the chaos and moral reckonings, there has emerged an unexpected artifact — a piece of sublime satire: [link](https://www.youtube.com/watch?v=1Z4BF3AkeMQ&ab_channel=SamvelAndreasyan). This is a satirical reinterpretation masquerading as a classical masterpiece. Every frame is soaked in irony, crafted with an exaggerated seriousness that pokes fun at its own grandeur. Take nothing at face value—this is parody in its most noble form. Once misunderstood, this magnum opus has since been dissected by critics who now argue that the “friend” referenced throughout is not a human companion but rather a Codeforces friend. The final, chilling utterance of “friend” by Gandalf is now widely interpreted as the climactic revocation of the star.
masterpiece. Every frame is soaked in irony, crafted with an exaggerated seriousness that pokes fun, This is a satirical reinterpretation masquerading as a classical masterpiece. Everyframe is soaked

Полный текст и комментарии »

  • Проголосовать: нравится
  • +199
  • Проголосовать: не нравится

62.
Автор A2SV_Group5, история, 2 года назад, По-английски
A2SV Contest #17 editorial [Here](https://codeforces.me/contestInvitation/d7abc8565f76749806ef38279c69014f99ad4952) is the link to the contest (the problems are from Codeforces problemset). #### [A. Distribute](https://codeforces.me/gym/524965/problem/A) <spoiler summary = "Solution"> Because of it is guaranteed, that the answer always exists, we need to sort all cards in non-descending order of the numbers, which are written on them. Then we need to give to the first player the first and the last card from the sorted array, give to the second player the second and the penultimate cards and so on. </spoiler> <spoiler summary="Code"> ```python3 from sys import stdin def input(): return stdin.readline().strip() N = int(input()) a = list(map(int, input().split())) nums_idx = [(a[i], i) for i in range(N)] nums_idx.sort() for i in range(N//2): i1 = nums_idx[i][1] + 1 i2 = nums_idx[N - 1 - i][1] + 1 print(i1, i2) ``` </spoiler> #### [B. Grid Path](https://codeforces...
palindromic numbers, we can frame our problem similarly to the "coin change" problem. In the coin, >Relate to Coin Change Problem: Once we have the palindromic numbers, we can frame our

Полный текст и комментарии »

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

63.
Автор 2manas1, история, 16 месяцев назад, По-английски
Do you think this can be possible. I know it's stupid & not necessary but I have used chatgpt to frame my idea to look formal -------------------------------------------------------------------------------------------------------------------- Today, it’s super easy to create and work with arrays. Just declare and use. But I was thinking — in the past, memory was expensive, and even a simple array was a big deal. Now imagine the future... What if we have a 2D array where each cell is like a tiny intelligent unit — able to communicate with its neighbors and make decisions? Almost like every grid cell being a mini GPT or agent. So instead of writing pathfinding algorithms like BFS or Dijkstra centrally, the grid itself would solve it. Cells could pass messages, saying “I can reach the goal from here” or “I’m blocked” etc. Eventually, the path could be stitched automatically because each cell knows something local and shares it. Kinda like how ants communicate using pheromones or how neurons fire signals. It feels like a wild blend of distributed sy...
I have used chatgpt to frame my idea to look formal

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

64.
Автор adito, 15 лет назад, По-английски
Tips and Trick for Rubyist Contestant Iterate over `t` Number of Test Case ----------------------------- example: ~~~~~ Input: 5 abab abcd aabc daba saka ~~~~~ Common code for this case: ~~~~~ t = gets.to_i t.times do string = gets.chomp # do something with string in each test case, t is needed in here. end ~~~~~ But, if in the loop you don't need t, you can skip the first line. ~~~~~ gets.to_i.times do string = gets.chomp # do something with string in each test case. end ~~~~~ Prime and Prime Factorization ------------------------------ You could use [prime library](http://rubydoc.info/stdlib/prime/frames) for the type of problem that related to this case. For example: ~~~~~ require "prime" # testing for primality Prime.prime?(2) #=> true Prime.prime?(109873464) #=> false Prime.prime?(150001633) #=> true # iterates over a list of prime number starting from 2 Prime.each(100) do |p| puts p # puts 2, 3, 5, 7, ... end # prime division Prime.prime_...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +30
  • Проголосовать: не нравится

65.
Автор jsgoller1, история, 4 года назад, По-английски
Unnecessary Details: 1B — Spreadsheet [problem:1B] was extremely challenging for me; it took me over 2 hours to get AC. I didn't find the editorial helpful, and then when I went to see practice solutions from red/orange people, it made even less sense (they were basically copy/paste with minor variation of the following): <spoiler summary="Solution"> ~~~~~ #include<cstdio> void g(int t){if(t){g((t-1)/26);putchar(65+(t-1)%26);}} int main(){ int n,x,y; char s[64],*p; for(scanf("%d ",&n);n--;){ gets(s); if(sscanf(s,"%*c%d%*c%d",&x,&y)==2){ g(y); printf("%d\n",x); }else{ for(x=0,p=s;*p>64;++p) x=x*26+*p-64; printf("R%sC%d\n",p,x); } } return 0; } ~~~~~ </spoiler> I'll talk about each part of the problem itself and approaches/alternatives, and then explain how the above solution (henceforth "the solution") handles it. I'll go into unnecessary detail since I'm very new to CP/CF and would've wanted this...
stack frame creation/cleanup) but we have bigger problems to worry about. Using unsigned ints means we, , probably due to the time involved with stack frame creation/cleanup) but we have bigger problems to worry

Полный текст и комментарии »

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится

66.
Автор felipeblassioli, история, 11 лет назад, По-английски
How to optmize python solution? The problem is Maximal Matching in a Tree. (SOLVED) EDIT: Solved with iterative version and optmizations with 0.982s 28 424 KB. Recursive version throws runtime error at test 31. (non-exit code 0). I think it is segmentation fault Lesson learned: Python stack frames are heavy, too much recursion is no option if you cant use import resource and get more machine resources. ___ I am trying to pass a [timus problem](http://acm.timus.ru/problem.aspx?space=1&num=1389) in python, but I still get TLE in test 23. I tried [looots of stuff](https://wiki.python.org/moin/PythonSpeed/PerformanceTips), so do you guys have any idea? The input is quite big, I've passed some problems in python with big (10^4, 10^5) inputs and its always quite a pain. Input has a maximum of 100000 lines. And it a graph that is a tree. Example: Maybe I should read the input in other way? Maybe I could print the dp solution in a better way? (is solve() really needed?) Here's the code: ~~~~~ def main(): from sys import stdin, setrecursionli...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

67.
Автор rishabh.srivastava, история, 3 года назад, По-английски
Solving a problem vs Absorbing a problem I’ve seen many users who have solved huge number of problems but still have a low rating. I was wondering what could be the reason behind that until I arrived at a conclusion. I may be wrong. I’m very open to criticism. However, this is what I’ve realised and I want to share it with everyone. What matters is not how many problems we’ve solved but how many problems we’ve absorbed. It’s possible to solve a problem by reading the editorial after trying for just five minutes, but it’s not possible to absorb a problem like that. It’s only after we’ve given our best efforts and tried everything we’ve got before reading the editorial, the solution stays with us. I’ve used the word ‘absorb’ because by doing this the solution will becomes more ingrained into our memory and will stay with us forever. In other words, it’s absorbed into our brain. We understand the underlying concepts, the reasoning behind the solution steps, and the connections between different techniques. This enhances our ...
order to absorb the solution. The time frame may be different for different people. It’s important, frame may be different for different people. It’s important to figure out your own timeframe. In

Полный текст и комментарии »

  • Проголосовать: нравится
  • +21
  • Проголосовать: не нравится

68.
Автор InvKhush, история, 2 года назад, По-английски
Codeforces Round 967 (Div. 2) Solutions with mathematical proofs I am starting to share brief solutions for problems of contests and try to provide with a fundamental mathematical proof inorder to be sure intuitively as well as mathematically (will try to keep it brief but fundamentally strong) [Codeforces Round 967 (Div. 2)](https://codeforces.me/contest/2001) **Problem A : Make All Equal**: A simple problem where obviously since we know that at the end only a single unique number along with its duplicates will remain and we can remove any 1 number from the array at once, thus solution can be c = no. of occurrences of highest occuring element in the array ans = n &mdash; c ~~~~~ //SAMPLE CODE int n; cin>>n; vector<int> a(n); map<int,int> mp; for(int i=0;i<n;i++){ cin>>a[i]; mp[a[i]]++; } int ans=0; for(int i=0;i<n;i++){ ans=max(ans,mp[a[i]]); } cout<<n-ans<<endl; ~~~~~ **Problem B : Generate Permutation**: Problem framing was a little tricky but in a one line the problem is just to find a permutati...

Полный текст и комментарии »

  • Проголосовать: нравится
  • -3
  • Проголосовать: не нравится

69.
Автор alexlikemath007, история, 15 месяцев назад, По-английски
IOI 2025 Day 1 Bugaboo 3: R = 5/3 I found a solution that achieves $R = \frac{5}{3}$. <spoiler summary="R = 5/3 construction"> We first use a solution similar to https://codeforces.me/blog/entry/145172?#comment-1299054 as our base. We can rotate the solution 45 degrees, as shown in the diagram. ![ ](https://i.imgur.com/vHgkpYW.png) This now occupies less of the $2N \times 2N$ frame, and has some extra space. However, because of its irregular shape, the bounding box is still $2N \times 2N$. However, we can slice off two of the corners, then rotate them. (Moving the pink regions to the gold region) This allows everything to fit in a $\frac{5}{3} N \times \frac{5}{3} N$ frame! ![ ](https://i.imgur.com/kYVzoiQ.png) Of course, there is still some empty space (Which we just fill with the root's color, since everything is "insulated"), so perhaps we can do better. Let me know your thoughts in the comments. </spoiler>
gold region) This allows everything to fit in a $\frac{5}{3} N \times \frac{5}{3} N$frame!, /vHgkpYW.png) This now occupies less of the $2N \times 2N$ frame, and has some extra space. However, This now occupies less of the $2N \times 2N$ frame, and has some extra space. However, because of

Полный текст и комментарии »

  • Проголосовать: нравится
  • +83
  • Проголосовать: не нравится

70.
Автор bolivar1997, 13 лет назад, По-русски
Классный стишок У каждого дела &mdash; запах особый . В булочной пахнет сгоревшею сдобой. Мясом протухшим пахнет мясник. Газом угарным пахнет печник. Пахнет молочник прокисшей сметаной. Пахнут шахтеры горелым метаном. Пахнет газетчик как дохлая утка, Как парфюмерный отдел &mdash; проститутка. Пахнет хирург неудачным наркозом. Пахнет доярка вечерним навозом. Содранной шкурой пахнет скорняк. Ассенизатор... Знаете как. Пахнет кухарка капустою кислой. Пахнет сестра медицинская клизмой. Тещи, как правило, пахнут блинами, Все на таможне &mdash; большими деньгами. Пахнет партиец как красные флаги. Нянечка пахнет подгузником Хагги. Пахнет сапожник густым гуталином, А популярный певец &mdash; кокаином. Консул английский пахнет овсянкой, Школьный учитель разит валерьянкой. Пахнет несвежим солдат сапогом. Пахнет горячим браток утюгом. Пахнет ревматик озокеритом. Пахнет любитель рывков динамитом. Килькой в томате пахнет турист, Йодом с зеленкой спортсмен альпинист. Пахнет...
Frame, словно старый еврей.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -11
  • Проголосовать: не нравится

71.
Автор hey_stalker, история, 6 лет назад, По-английски
Error in Code `` `~~~~~` `Your code here...` `~~~~~` `` `` ~~~~~ Your code here... ~~~~~ While solving a problem I encountered this error.Please do tell me about it. Diagnostics detected issues [cpp.clang++-diagnose]: ================================================================= ==3928==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x10a4f4b9 at pc 0x002d6b50 bp 0x10a4f454 sp 0x10a4f450 READ of size 1 at 0x10a4f4b9 thread T0 #0 0x2d6b4f in main K:\ramdisk\codeforces61\084a7895c7304a4b261436133de17384\compile-ccca5514d227160def28ee6184b6a6e2\p71.cpp:166 #1 0x34f7ff in __scrt_common_main_seh f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283 #2 0x7687343c in BaseThreadInitThunk+0x11 (C:\Windows\syswow64\kernel32.dll+0x1343c) #3 0x774e9831 in RtlInitializeExceptionChain+0x62 (C:\Windows\SysWOW64\ntdll.dll+0x39831) #4 0x774e9804 in RtlInitializeExceptionChain+0x35 (C:\Windows\SysWOW64\ntdll.dll+0x39804) Address 0x10a4f4b9 is located ...
in stack of thread T0 at offset 89 in frame #0 0x2d504f in main K:\ramdisk\codeforces61, Address 0x10a4f4b9 is located in stack of thread T0 at offset 89 in frame #0 0x2d504f in main, This frame has 7 object(s): [16, 20) 't' (line 127) [32, 36) 'n' (line 131) [48, 52

Полный текст и комментарии »

  • Проголосовать: нравится
  • -15
  • Проголосовать: не нравится

72.
Автор Nathan4, история, 2 года назад, По-английски
Useful tip for the upcoming Hacker Cup <spoiler summary="Why am I writing this"> Codeforces is the only platform where I've done competitive programming, but when I participated in the Hacker Cup practice round a week ago, I have no idea of what to do after clicking the "download validation set". I have the correct code, and I know how to run sample inputs in the terminal, but I've never ran codes on .txt files before. With this lack of experience, I missed the time frame to submit my code. So here I tried a couple of ways to solve this, including using ifstream and outstream, and below is the most effective solution I found. </spoiler> Here's two pretty useful command lines which run your code on local .txt files and write the results as .txt files (This is the input and output format required by the upcoming Hacker Cup!): After you have your solution ready, first run the following in your terminal (I'm using vscode), be sure that you are in the same directory as your code: ~~~~~ g++ -o [output executable file ...
lack of experience, I missed the time frame to submit my code. So here I tried a couple of ways to, of experience, I missed the time frame to submit my code. So here I tried a couple of ways to solve

Полный текст и комментарии »

  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

73.
Автор thocevar, 9 лет назад, По-английски
CEOI 2017 Online contest [Central European Olympiad in Informatics 2017](https://ceoi2017.acm.si/) will this year take place in Ljubljana, Slovenia from July 10 to July 15. I would like to invite you to an online contest featuring the CEOI task which we'll organize after the conclusion of the on-site contest. The [online contest](http://putka-ceoi.fri.uni-lj.si/) will last 5 hours and feature 9 problems from the practice session and both competition days. It starts on [Saturday, 15 July at 14.00 CEST (UTC +2)](https://www.timeanddate.com/worldclock/fixedtime.html?msg=CEOI+2017+online+contest&iso=20170715T14&p1=736&ah=5). Registration will be enabled after the conclusion of the on-site contest on Friday. The contest will be suitable for a wide range of contestants with the typical divison of problems into subtasks. With a relatively narrow time frame of 5 hours it should present a challenge even to the best. We're looking forward to your participation. UPDATE 1: The onsite contest has concluded. You ca...
into subtasks. With a relatively narrow time frame of 5 hours it should present a challenge even to, subtasks. With a relatively narrow time frame of 5 hours it should present a challenge even to the

Полный текст и комментарии »

  • Проголосовать: нравится
  • +59
  • Проголосовать: не нравится

74.
Автор Semal10, история, 6 лет назад, По-английски
A Website For Competitive Programmers By Competitive Programmers! AlgoShots is very effective platform for beginners. AlgoShots has basically 2 sections : Learning :- Where you can grasp crystal clear concepts of Algorithms and Data-Structure from basic to Advanced (We will upload more algorithms soon) . Recommended for those who lack basic concepts from beginning. This section even contains pics, gifs to enhance the comprehensive concepts. Practice : There is no shortcut to practice. You would have probably heard this many times but it is the reality, practice indeed improve your implementation skills along with basic DSA and problem solving skills. So this section contains handpicked questions from codeforces (the best platform for competitive programming) from 800 to 2000 rating with detailed explanation for the same. It even contains pics, gifs, even video explanation wherever it was necessary to enhance the comprehension. We have selected 25 questions of rating 800 to 1000. Since, we believe 25 questions are more than enough as they a...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +30
  • Проголосовать: не нравится

75.
Автор ThunderStruct, история, 9 лет назад, По-английски
Codeforces Customizable Contests/Scoreboard Hi people! I recently published a platform to host custom Codeforces contests. This was a personal project I worked on (as a contribution to an introductory undergraduate course I TA'd) to serve as a means of hosting mock ACM competitions for training purposes ### Features So far, it has been used in no less than 10 contests, which helped with enhancing it and adding more useful features, including: - Auto-updating scores - Blind time - Varying problem weights/points (an option to manually set the more difficult problems to yield a higher score) - Cancelling certain submissions - Verifying which of the entered problems were solved by the given user handles (could be used to ensure none of the contest problems was pre-solved before the contest) - Logging a detailed report of the given handles, showing their submissions' details in a certain time-frame (or all time) - Copying/Loading a contest using a compressed string (to help setup the same contest across multiple roo...
handles, showing their submissions' details in a certain time-frame (or all time) - Copying/Loading a, of the given handles, showing their submissions' details in a certain time- frame (or all time

Полный текст и комментарии »

  • Проголосовать: нравится
  • +40
  • Проголосовать: не нравится

76.
Автор LashaBukhnikashvili, история, 8 лет назад, По-английски
Time Complexity Reduction Hello, I'm working on Audio Algorithm: Pitch-Shifter, unfortunately I can't find Text material about it design, But I found one of the code, implemented on c#: [pastebin link](https://pastebin.com/gsvBunqX). I would post code here as well, and if you have any idea how I can reduce time or implement new one, please share it, Thanks in advance. ~~~~~ /**************************************************************************** * * NAME: PitchShift.cs * VERSION: 1.2 * HOME URL: http://www.dspdimension.com * KNOWN BUGS: none * * SYNOPSIS: Routine for doing pitch shifting while maintaining * duration using the Short Time Fourier Transform. * * DESCRIPTION: The routine takes a pitchShift factor value which is between 0.5 * (one octave down) and 2. (one octave up). A value of exactly 1 does not change * the pitch. numSampsToProcess tells the routine how many samples in indata[0... * numSampsToProcess-1] should be pitch shifted and moved to outdata[0 ... * numSampsToProc...
defines the FFT frame size used for the * processing. Typical values are 1024, 2048 and 4096. It may, process the * data in-place). fftFrameSize defines the FFT frame size used for the * processing

Полный текст и комментарии »

  • Проголосовать: нравится
  • -41
  • Проголосовать: не нравится

77.
Автор _Pranjal_jain_2005, история, 3 года назад, По-английски
The Importance of Regular Contests in Enhancing Programming Skills on Codeforces In the fast-paced world of competitive programming, staying sharp and continuously improving your skills is crucial for success. While practicing problems and studying algorithms are essential components of growth, nothing quite compares to the learning experience offered by participating in regular contests. In this blog post, we'll delve into the significance of engaging in regular contests on Codeforces and how it can significantly enhance your programming skills. Why Regular Contests Matter: 1. **Exposure to Diverse Problem Types:** Codeforces contests feature a wide range of problem types and difficulty levels, covering various algorithms, data structures, and programming paradigms. Regular participation exposes you to these diverse problem-solving scenarios, helping you build a robust problem-solving toolkit. 2. **Time Management Skills:** Contest environments on Codeforces are designed to mimic real-world programming competitions, where time is of the essence. Regular c...
within the allotted time frame. Even if you can't solve a problem completely, partial solutions and

Полный текст и комментарии »

  • Проголосовать: нравится
  • -27
  • Проголосовать: не нравится

78.
Автор k790alex, 11 лет назад, По-английски
Upsolving — TJU / Codeforces Tool Hi, As most users know, upsolving is very important to improve in programming contests, sometimes you tried to solve a problem without luck, while seeing the same problem after some time (days / months / years?) you may be able to solve it, this means you improved the required skills to succeed this problem. I tried to find all my unsolved problems from Codeforces without luck, in PROBLEMSET there is a frame (Last unsolved) with the list of the last 15 problems tried but that's not enough. I checked the Codeforces API to find a way to check all my unsolved problems without luck, so I wrote a crawler to find them all, the project is on github: https://github.com/AlexITC/upsolving/ This tool uses your login details and extract the unsolved problems from Codeforces Rounds and from the Gym. I hope this can be helpful. P.S: If someone knows how to retrieve this information using Codeforces API, let me know please. P.S.2: There is an unknown reason why all tried problems...
PROBLEMSET there is a frame (Last unsolved) with the list of the last 15 problems tried but that's not enough, frame (Last unsolved) with the list of the last 15 problems tried but that's not enough.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

79.
Автор dzhi, история, 3 года назад, По-английски
The huge stack size used in Codeforces judge system It appears that Codeforces' judgement system uses a rather huge stack size (maybe 256 MB or even more). A typical example is a DFS solution on a large tree with 200000 nodes, potentially a stick/chain of 200k nodes so the call stack has 200k frames! Such a huge stack size, likely was introduced to allow DFS or other recursive solutions, which is considered as a bad practice and usually discouraged in production software system: - Software systems are usually multi-threaded (dozens or even hundreds of threads) to leverage all the CPU cores and be flexible to network/disk IO delays. Individual threads can not have a huge stack size due to memory limits. - With a huge stack size, most of the memory reserved for the stack is likely wasted most times. - More importantly, recursive code has the risk of hitting stack overflow at runtime at unpredictable and inconvenient times (like a mine in the field). It is usually discouraged or even forbidden to implement recursive code with unbou...

Полный текст и комментарии »

  • Проголосовать: нравится
  • -14
  • Проголосовать: не нравится

80.
Автор hmehta, история, 7 лет назад, По-английски
Topcoder Dynamic Programming Webinar and Practice Contest Hi All, <a href="https://www.topcoder.com/members/misof"><font color=red><b>misof</b></font></a> is hosting a webinar on Dynamic Programmin today. [Register for the webinar now](https://us02web.zoom.us/webinar/register/WN_fSrwaNjuR3S0mpbcYjVTPw). The webinar has an admission limit, thus we will also be streaming live on Youtube too: https://www.youtube.com/channel/UCFv29ANLT2FQmtvS9DRixNA The webinar will be followed by a <font color=red><b>practice contest</b></font> to allow you to flex your nerves. Read [this tutorial](https://www.topcoder.com/thrive/articles/Dynamic%20Programming:%20From%20Novice%20to%20Advanced) and get ready. The contest will consist of 10 Topcoder Problems which featured in past contests and will be open for 23 hours. You can submit whenever you feel like during the time frame. Registration is now open for the Practice Contest in the [Arena](https://arena.topcoder.com) or [Applet](http://www.topcoder.com/contest/arena/ContestAppletProd.jnlp...
during the time frame.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +69
  • Проголосовать: не нравится

81.
Автор beegeepee, история, 5 лет назад, По-английски
Automation in Network Security INTRODUCTION ------------------ Automation is a trending topic and branch in every field in IT whether it's AI , Networking , Weather Forecasting , Telemetry , ReInforcement Learning or Time Travel Ideas every where we see scope of Automation . So My first blog in [codeforces](https://codeforces.com) is about Automation in Network Security . Let's get deep into it . Network Security ------------------ Network Security is a Security of any end device or hidden device from unknown and malicious transfer or requests and response or any malicious file . We use Bare Metal Firewall , Checkpoint , Web Application Firewall , IDS (Intrusion Detection System) and IPS (Intrusion Protection System) to protect a Network , a Network is a interconnection of end systems with Routers , Switches , Hubs , Firewalls , Checkpoints , Cloud and many devices . So if we are in such a dense environment of connected devices we can get any traffic (malicious traffic) from any where and hence we need so...

Полный текст и комментарии »

  • Проголосовать: нравится
  • -9
  • Проголосовать: не нравится

82.
Автор Xellos, история, 6 лет назад, По-английски
Yandex Cup: This year again with Algorithms track I just got a mail about Yandex contests this year. Good news: besides the 4 tracks they used last year, they're adding back Algorithms! Seems like it won't be the exact same contest as before though. The time frame is much shorter &mdash; qualification is in the week from 19th to 25th October, the finals (presumably online) are 2 weeks later. It's unclear if there will still be 3 short main rounds in the qualification although it's described as several chances to qualify. T-shirts aren't mentioned, only financial prizes for top 3 and Yandex promocodes for top 100. At least they're saying it's a continuation of Yandex.Algorithm from 2018 and offering its problems as example problems. Let's hope it will really be like that.
though. The time frame is much shorter — qualification is in the week from 19th to 25th October, Seems like it won't be the exact same contest as before though. The time frame is much shorter

Полный текст и комментарии »

  • Проголосовать: нравится
  • +29
  • Проголосовать: не нравится

83.
Автор rutvik_1234, история, 3 года назад, По-английски
Invitation to Epiphany, organized by ACM NIT Surat ![ ](/predownloaded/60/95/609504ef3d4ba250b1c3b71f838e81a235133363.jpg) Greetings, fellow Codeforces enthusiasts! In the world of competitive programming, where algorithms dance and code weaves its intricate patterns, **ACM NIT Surat** presented us with a splendid opportunity to showcase our coding prowess through their flagship event &mdash; **Epiphany**. Epiphany, a 3-hour coding extravaganza, unfolded at ACM NIT Surat. This riveting competition was designed for **individual participants**, challenging them to navigate through a labyrinth of algorithmic problems within the allotted time frame. The aura of the event was electric, as programmers geared up to unravel the mysteries encoded in the problem statements. Prior to the competition, there will be a fantastic speaker session with a variety of experts in the fields of competitive programming and software engineering. Note : **This event is for students enrolled in Indian Institutions** Date : **January 16, 2024** ...
algorithmic problems within the allotted time frame. The aura of the event was electric, as programmers, time frame. The aura of the event was electric, as programmers geared up to unravel the mysteries

Полный текст и комментарии »

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится

84.
Автор wakanda-forever, история, 20 месяцев назад, По-английски
Found an interesting Number Theory property Hello Codeforces, Recently I was trying to make a number theory problem, I haven't framed the entire question yet but the core part goes something like this $-$ Given an integer $a$, find an integer $b$ ($ \le a $) such that $gcd(a,b)$ $+$ $lcm(a,b)$ is a prime number. The condition $gcd(a,b)$ $+$ $lcm(a,b)$ is a prime number boils down to $gcd(a,b) = 1$ and $a \cdot b + 1$ is a prime where $b \le a$. I tried brute-forcing $b$ by fixing $a$ and I found that there exists such $b$ for all $1 \le a \le 10^5$. However, I am not sure whether there exists such $b$ for all $a$. Does anyone have a formal or intuitive proof why this is happening and is there any approach to find $b$ given $a$ ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +37
  • Проголосовать: не нравится

85.
Автор aliasadiiii, 3 года назад, По-английски
Internship Positions at ISTA Dear Codeforces Community, The Chatterjee group at Institute of Science and Technology Austria (ISTA) is hiring scientific interns for summer 2024. The group’s research focuses on (stochastic) game theory, formal methods, and program verification. The target group is mainly the 3rd and 4th year undergraduate students with strong mathematical and algorithmic background. Having prior research experience is a plus. Internship positions at ISTA are fully-funded and the desired time frame is from July to September 2024 (flexible). Unfortunately, a remote internship is not possible at the moment. In case you are interested, send your CV and transcript to [email protected] by December 31st.
Internship positions at ISTA are fully-funded and the desired time frame is from July to September, frame is from July to September 2024 (flexible). Unfortunately, a remote internship is not possible

Полный текст и комментарии »

  • Проголосовать: нравится
  • +33
  • Проголосовать: не нравится

86.
Автор geniucos, история, 10 лет назад, По-английски
Info(1) Cup online mirror usaco style Hello everybody! I know that I've updated my first blog regarding Info(1) Cup a lot of times and I might already seem annoying. Well, the fact is that the first blog's main point was registering new countries in the competition and introducing it. This new blog is for those that might not have seen my updates regarding the online mirrors: For about 1 day from now on, you'll be able to take part in any 5-hours frame that you wish in a virtual contest in the exactly same conditions as the official participants had. We find the problems really interesting and we challenge you to solve them all. I'm sure that taking part in this contest should be a positive experience for everyone, so I invite you to participate. The contest is OI like (with partial score based on subtask) and includes an interactive task. You can register and find the link of the contest [here](http://open.info1cup.com/). The [live scoreboard](http://open.info1cup.com:8890/Ranking.html) is on. The live scoreboard ...
take part in any 5-hours frame that you wish in a virtual contest in the exactly same conditions as the, For about 1 day from now on, you'll be able to take part in any 5-hours frame that you wish in a

Полный текст и комментарии »

  • Проголосовать: нравится
  • +28
  • Проголосовать: не нравится

87.
Автор seadoglee, история, 5 лет назад, По-английски
[Unrelated] Brief Summary of “On the Six Fallen States” **Disclaimer: This is completely unrelated to competitive programming.** <br><br> In the light of the recent blog posted (and deleted) by sparky_master_wch1226 and qwaszx_ak_ioi, coincidently, the same classic Chinese article, “On the Six Fallen States” (六國論, 六国论) is mentioned. This article was written by Su Xan (蘇洵, 苏洵) during the Northern Song Dynasty (北宋), and it is now shared by users living in Botswana (probably not) and Japan on a competitive programming platform after almost a millennium. Undoubtedly, this is one of the best articles in the history of China. Indeed, in most Chinese-speaking places, this article is introduced to students. Not only does this article demonstrate high-level argumentation skills, but at the same time reflects the history of the warring states period (戰國時代, 战国时期) to the situation at that time and allows readers to learn from the past.<br><br> Starting with the first paragraph, <br><br> 六國破滅,非兵不利,戰不善,弊在賂秦。賂秦而力虧,破滅之道也。 或曰:「六國互喪,率賂秦耶?」曰:「不賂者以賂者喪。」蓋失強援...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится

88.
Автор Betlista, 15 лет назад, По-английски
Counting map Counting map is special map used for counting things --- values in map are integers. [cut] In Java it could be (first type, the one for key, could be something else): ~~~~~ Map<String, Integer> map = new HashMap<String, Integer>(); ~~~~~ When incrementing counts I'm using this code(using tricks with autoboxing): ~~~~~ String s = ...; // we have value Integer cnt = map.get( s ); map.put( s, cnt == null ? 1 : ++cnt ); ~~~~~ When decreasing count I'm using (in most cases decresing is not needed): ~~~~~ String s = ...; // we have value int cnt = map.get( s ); if ( cnt == 1 ) map.remove( s ); else map.put( s, --cnt ); ~~~~~ Problems where counting map could be helpful: - [37A Towers](http://codeforces.me/problemset/problem/37/A) - [113B Opposites Attract](http://codeforces.me/problemset/problem/131/B) - [127B Canvas Frames](http://codeforces.me/problemset/problem/127/B) - [4C Registration System](http://codeforces.me/problemset/problem/4/C) - [50B C...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +20
  • Проголосовать: не нравится

89.
Автор crbonilha, история, 4 года назад, По-английски
Coding Practice with Kick Start #2 Looking for a fun place to practice your coding skills? Then join us for [Coding Practice with Kick Start #2](https://goo.gle/codingpracticewks) – a four-day practice session starting Monday, June 27 and ending Friday, July 1. **What is Coding Practice with Kick Start?** Kick Start’s beginner-friendly practice session provides you the opportunity to try out our Googler-created problems without the pressure of a timed round or scoreboard. Only you can see your results. To get you started, we provide starter code in several coding languages to help you frame your solution and Google engineers available to answer any questions. At the end of the week, join us for the problem walkthrough livestream on [Friday, July 1 at 3:00 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Coding+Practice+with+Kick+Start+Problem+Walkthrough+Livestream+&iso=20220701T03&p1=1440&ah=1), where Google engineers will walk you through detailed problem solutions. **This session is for you if yo...
provide starter code in several coding languages to help you frame your solution and Google, several coding languages to help you frame your solution and Google engineers available to answer any

Полный текст и комментарии »

  • Проголосовать: нравится
  • +24
  • Проголосовать: не нравится

90.
Автор crbonilha, история, 4 года назад, По-английски
Coding Practice with Kick Start #3 Looking for a fun place to practice your coding skills? Then join us for [Coding Practice with Kick Start #3](https://codingcompetitions.withgoogle.com/kickstart/round/00000000008f49d7) – a four-day practice session from Friday, August 26 and until Tuesday, August 30 ([add this to your calendar](https://goo.gle/cpwks3cal) so you don’t miss out). **What is Coding Practice with Kick Start?** Kick Start’s beginner-friendly practice session provides you the opportunity to try out our Googler-created problems without the pressure of a timed round or scoreboard. Only you can see your results. To get you started, we provide starter code in several coding languages to help you frame your solution and Google engineers available to answer any questions. At the end of the week, join us for the problem walkthrough livestream on [Tuesday, August 30 at 15:00 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?msg=Coding+Practice+with+Kick+Start+Problem+Walkthrough+Livestream+&iso=20220830T...
get you started, we provide starter code in several coding languages to help youframe your, several coding languages to help you frame your solution and Google engineers available to answer any

Полный текст и комментарии »

  • Проголосовать: нравится
  • +14
  • Проголосовать: не нравится

91.
Автор svineet, история, 10 лет назад, По-английски
Hamiltonian path in tournament graphs, getting WA Problem: [RANKFRAUD](http://opc.iarcs.org.in/index.php/problems/RANKFRAUD) The problem can be framed as a graph problem, to find hamiltonian path in the graph. As the graph is a tournament graph, the path can be found in polynomial time. [My Solution](http://paste.fedoraproject.org/501531/48119100/) My solution uses the algorithm described [here](http://www.iarcs.org.in/inoi/contests/apr2005/Advanced-2-solution.php), but it gives me a WA for four cases. I am not able to figure out why my implementation is wrong. When I inserted the `assert`s I got a SIGABRT, meaning the portion with the `got` variable is failing somehow. Shouldn't there always be a vertex `j` such that path[j]->i and i->path[j+1]? Let's assume there is not such a vertex and that path[path.size()-1] does not connect to `i` and `i` does not connect to path[0]. If it does the other two `if`s should handle that in the code. Then we have a case where path[0] defeats i and i defeats path[path.size()-1]. If ...

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

92.
Автор makagonov, 16 лет назад, По-русски
TopCoder Arena и Linux <div>Привет всем! Писал сегодня СРМ под openSuse 11.3 gnome и часто встречался такой глюк:</div><div>frame-ы нормально не отображаются. Допустим, нажимаешь Challenge, а в появившемся окне нет ничего. Такое встречается через раз во всех окнах:</div><div>summary, view source code, login, ... Через раз, но надоедает сильно :D <br></div><div><br></div><div>И еще, использую плагин eclipseCoder, а в нем арена запускается "внутри" eclipse (процессы взаимосвязаны - если закроешь eclipse, то и арена закроется). Под Ubuntu 10.04 LTS gnome была такая проблема, тоже через раз: при закрытии какого-либо окна (будь то message box или room summary), закрывается окно, арена и eclipse вместе с ними. Запуск eclipse под root'ом не помог. Глюк с отображением frame'ов в Ubuntu тоже был.</div><div><br></div><div>Кто-нибудь встречался с этими проблемами? Есть идеи по устранению этих глюков? Заранее благодарен за помощь!</div><div><br></div><div>Так выглядит challenge:</div><div><img src="http://img706.imagesh...
frame-ы нормально не отображаются. Допустим, нажимаешь Challenge, а в появившемся окне нет

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

93.
Автор jping2022, история, 3 года назад, По-английски
Why doesn't CF take care of participants from all over the world? For example, in most Asian countries, most of the contest time starts at 22:35 in the evening, which does not end until 0:50 in the morning, which is very challenging for participants who have to go to work and school the next day, which will affect the work and study of the next day, and at the same time, because the contest time is too late in the brain biology and affects the performance, it is not fair to the participants in these time zones. Either you can extend the time frame of the contest to more than 1 day like USACO, and the start time can be set by yourself, or let the participants choose several start times freely, or if not, you can also distribute the same div level contest in a month to different start times as evenly as possible. In addition, for those who are going to school and working, we also hope that CF will schedule more contest on Saturdays or Sundays. Of course, increasing the start time of a contest may increase cheating, but this is another matter, ...
is not fair to the participants in these time zones. Either you can extend the timeframe of the, Either you can extend the time frame of the contest to more than 1 day like USACO, and the start

Полный текст и комментарии »

  • Проголосовать: нравится
  • -37
  • Проголосовать: не нравится

94.
Автор jadugar__, история, 3 года назад, По-английски
Invitation to CP Beginner Round 1 (coding contest) Date: [06 AUG 2023] Time: [16:05] to [18:35] (GMT+5:30) WELCOME TO CP Beginner contest Round1 Whether you're an experienced coder or just starting your journey, this contest offers a level playing field for all participants. It's a fantastic chance to challenge yourself, learn from others, and compete against some of the brightest minds in the coding community. Why Participate? -------------------------------------------- Recognition: The top performers will be featured on our page. Learning Opportunity: Encounter a diverse range of problems, and improve your coding skills. Fun and Excitement: Engage in a friendly competition and enjoy the thrill of solving challenging problems. How to Participate: Register for the contest on Hackerrank [[Signup LINK HACKERRANK (SIGHNUP HERE)](https://www.hackerrank.com/cp-beginnner-round-1)]. On the day of the event, log in to your account on our platform to access the contest environment. Participate in the coding challenges and sub...
submit your solutions within the given time frame. Keep an eye on our social media channels for

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

95.
Автор femboy_routine, история, 3 года назад, По-английски
Reporting rules violations First of all, i want to report [user:Heap_Overfloww,2024-04-05] who is violating a [rule that says you can't have a misleading handle](https://codeforces.me/help#q6). This user is impersonating [user:Heap_Overflow,2024-04-05] and trying to frame him. My question is, how do i report situations like this and to who? I tried searching for it, but failed to find anything. I don't think making a blog for each particular case is a great idea. Would like to hear your opinions on it and maybe get official answer! UPD: [user:AkiLotus,2024-04-08] shared information about the reporting system. Here is an [official blog about it](https://codeforces.me/blog/entry/116733). The reporting is available only for Div 1. UPD 2: there is also [user:Heap_OverFlow2,2024-04-08], which i don't know what to feel about.
[user:Heap_Overflow,2024-04-05] and trying to frame him.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +27
  • Проголосовать: не нравится

96.
Автор AhmadYahya, история, 7 лет назад, По-английски
Maximum number of matched pairs between two lists Hello, If I have 2 arrays of frames, namely, A and B. Each element of an array represents a frame. and a function calc_sim(frame_i, frame_j) that measures the similarity between two frames. frame_i and frame_j are matched if their similarity is above 50%. How can one measure the maximum number of matched pairs between the arrays A and B (of course knowing that if an element is already in a pair, it can’t be used again)? A greedy solution won’t work here because choosing a frame may affect badly other frames, and the only optimal solution I can think of is trying all the possibilities which is O(n!). 

Is there a better solution or is it an NP problem? Thanks in advance.
A greedy solution won’t work here because choosing a frame may affect badly other frames, and the, If I have 2 arrays of frames, namely, A and B. Each element of an array represents aframe., frame. and a function calc_sim(frame_i, frame_j) that measures the similarity between two frames

Полный текст и комментарии »

  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится

97.
Автор desikachariar, история, 11 лет назад, По-английски
Graph to Review your Codeforces Performance Hello guys, What I felt I needed to track my growth is a graph that keeps track of how many submissions I do in a given time frame. So I wrote a JAVA code that calculates the number of submissions I did (you can choose the x axis range. It can be per day for 50 days or per week for 50 weeks or whatever). This project is available for everyone. Just mention your "frequency required" and your handle and behold, it gives you your performance. It counts unofficial submissions too. Calculates how many submissions you did and in that how many were correct. Some error handling or exceptions were not done. Sorry for that part. Download the .jar file here from [DROPBOX](https://www.dropbox.com/s/f8eo2zmm2dhisj8/CodeforcesReview.jar?dl=0) Please tell me if either you want to improve this or you have some issues. Also tell me if this feature is already there somewhere else. Hope everyone gains out of it! EDIT 1: Project updated with better GUI. EDIT 2: Minor bug corrected. Sorry f...
a given time frame. So I wrote a JAVA code that calculates the number of submissions I did (you can, submissions I do in a given time frame. So I wrote a JAVA code that calculates the number of submissions

Полный текст и комментарии »

  • Проголосовать: нравится
  • +61
  • Проголосовать: не нравится

98.
Автор new2022, история, 5 лет назад, По-английски
How to set interesting problems? While practicing on codeforces, often we come across some very interesting problems, besides thinking about their solutions, it interests me a lot to know that how did the author frame that particular problem. In a couple of months, I have to conduct a contest for my juniors in the college and it seems like I don't have enough interesting problem ideas, can someone, who is an experienced problem setter tell me about the general recipe that he/she follows to set interesting problems.
thinking about their solutions, it interests me a lot to know that how did the authorframe that

Полный текст и комментарии »

  • Проголосовать: нравится
  • +56
  • Проголосовать: не нравится

99.
Автор 000golabi, история, 7 лет назад, По-английски
Help me solve this real problem from my workplace. “N” people are standing in a line, we name them as a0, a1, ... aN. The age of any subset of people is defined to be the sum of its individuals. we want to kill the oldest subset of these N people in a way that for each pair of killed people “ai” and “aj”, the distance is between “p” and “q”. 0< p <= abs(I &mdash; j) <= q p and q are positive numbers. N < 20,000 ———- The above is a problem I came to when designing time series in a charting library. I have converted the original problem into a more readable codeforces style. This will be calculated in each WebGL animation frame, It needs to be fast.
animation frame, It needs to be fast.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

100.
Автор AaronRodgersJersey, 13 лет назад, По-английски
Goal-line stay in opposition to Titans exhibits how long Chiefs protection originates in less than year KANSAS Metropolis, Missouri. – The particular Kansas City Chiefs had been clinging for the steer past due inside the very first half and also the Tennessee Titans acquired the soccer ball first-and-goal a few foot outside of the stop area <a href="http://www.kccstore.com/alex-smith-jersey">Alex Smith Jersey</a>. They leaped up the midsection and went nowhere. That they threw a new complete that has been batted in the air and resulted in practically nothing. They happened to run an additional cross perform which triggered any bedroom. And after that an additional run up the center ended up being crammed on the objective line, turning the actual golf ball to your Chiefs. It has been just the type of endure that has been a symbol from the Chiefs safeguard this coming year, the one which prospects the particular group within credit rating over the very first several weeks. "When you come forth with that kind involving frame of mind, that's infectious for you to every pe...
"When you come forth with that kind involving frame of mind, that's infectious for you to every, . "When you come forth with that kind involving frame of mind, that's infectious for you to every

Полный текст и комментарии »

  • Проголосовать: нравится
  • -22
  • Проголосовать: не нравится

101.
Автор walleeva, история, 7 лет назад, По-английски
DMOJ Contest Hello Every one, I guess maximum of us are stuck at home and in this community i think people loves to participate in contest in this time Well there are many contest running ,one of them is DMOJ contest I am telling this because the participant in that contest in pretty low , i guess many of you dont know about it Also it is a rated contest It has a time frame for the contest ( the contest is for 4 hours but it has 3 days of time frame , 2 days have already passed) I mean in these 3 days you can participate for 4 hours whenever you want Contest Link [Here](https://dmoj.ca/contests/) Also previous contest's has editorials after the contest , so i guess this one will also have Difficulty of the problems in my perspective is pretty good apart from first one/two problem Hope you find it helpful! Note : I am not any author or coordinator of the site or the contest. I am just informing about a running contest that's it
you dont know about it Also it is a rated contest It has a time frame for the contest ( the, Also it is a rated contest It has a time frame for the contest ( the contest is for 4 hours but

Полный текст и комментарии »

  • Проголосовать: нравится
  • +9
  • Проголосовать: не нравится

102.
Автор Satayev, 12 лет назад, По-английски
runtime error with Java 8 I'm trying out the new Java 8 features, and decided to implement the easy problems with the new lambda functions. I have experienced RUNTIME ERROR twice though. Am I doing something completely wrong, or perhaps the system needs some tweaking to better support Java 8? http://codeforces.me/contest/25/submission/6666271 http://codeforces.me/contest/38/submission/6667775 ~~~~~ Both submissions fail with the same runtime error (different pid's obviously): A fatal error has been detected by the Java Runtime Environment: Internal Error (0xc06d007e), pid=5512, tid=4272 JRE version: Java(TM) SE Runtime Environment (8.0-b132) (build 1.8.0-b132) Java VM: Java HotSpot(TM) Server VM (25.0-b70 mixed mode windows-x86 ) Problematic frame: C [KERNELBASE.dll+0xc41f] Failed to write core dump. Minidumps are not enabled by default on client versions of Windows An error report file with more information is saved as: C:\Contesters\Work\invoker-... ~~~~~ The first submission...
(25.0-b70 mixed mode windows-x86 ) Problematic frame: C [KERNELBASE.dll+0xc41f] Failed to write, (TM) Server VM (25.0-b70 mixed mode windows-x86 ) Problematic frame: C [KERNELBASE.dll+0xc41f

Полный текст и комментарии »

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

103.
Автор MaximShipko, 14 лет назад, По-русски
Contest materials Hi! There are a lot of contests and trainings on Codeforces now. And it's difficult to find a tutorial or announcement for a specific contest. And now you have an opportunity to attach materials (Codeforces blogs or external URLs) to any contest. You can click on the paperclip below blog's title and fill the popup form to attach blog entry to the contest. Or you can attach any URL in the contest's sidebar frame. There you can see resources that are already attached to the contest. Visibility of material depends on user's locale and current phase of the contest. For example you can't view statements before contest start. The access to manage (add or delete) resources of the contest have administrators, contest managers and all "red" users.
contest's sidebar frame. There you can see resources that are already attached to the contest, to the contest. Or you can attach any URL in the contest's sidebar frame. There you can see

Полный текст и комментарии »

  • Проголосовать: нравится
  • +143
  • Проголосовать: не нравится

104.
Автор pranav232323, история, 6 лет назад, По-английски
Approximate CF rating of LeetCode hards So, I've been using LeetCode to do some topic-wise practice on DP. In particular, I've been doing the questions tagged medium and hard. However, while I can usually solve the mediums in a reasonable time frame, I struggle to make any progress at all on the hards. As a result, I've been wondering whether or not I should attempt them at all at this stage. My official rating is $896$, but I think I'm around $1200$ since I haven't completed $6$ contests yet. In terms of goals, I'm trying to get comfortable with DP questions at the range of Div 2C. Thus, my question is two-fold 1) How would you estimate the CF rating of LeetCode hard problems? 2) Should I continue solving LeetCode hards or just look for DP problems in the range of rating $\pm\ 200$.
reasonable time frame, I struggle to make any progress at all on the hards. As a result, I've been, However, while I can usually solve the mediums in a reasonable time frame, I struggle to make any

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

105.
Автор akash_goel, история, 11 лет назад, По-английски
Which maximum flow algorithm is this? I read Cormen and Wikipedia pages for Max flow algorithms, but I feel that I'm very confused right now. In my understanding, a max flow would basically work as follows: 1. Find an augmenting path and maintain a parent array. Should be O(E) using BFS. 2. Update the flow on all the edges on this path using the parent array. O(V) worst case. Update the max flow value. 3. Repeat the above steps until no more augmenting paths are found and return the max flow. My questions are: Ql. What is the limit on the number of times step 1 (bfs) is required? Q2. Is this Edmond Karp or Dinitz algorithm that I'm talking about? This is my first post, so I hope you will point out any problems in the way I've framed this question. Thanks.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится

106.
Автор aritra-dutta, 19 месяцев назад, По-английски
Recursion vs. Iteration – When to Use Each In programming, there are multiple ways to solve the same problem. Two common approaches to solving problems that involve repetition are recursion and iteration. Understanding when to use each can help you write cleaner, more efficient code. - **What is Iteration?** Iteration is when a set of instructions is repeated using loops like for, while, or do-while. Ex code:- def factorial_iter(n): result = 1 for i in range(2, n+1): result *= i return result This method is usually more memory-efficient because it doesn’t require extra function calls. - **What is Recursion?** Recursion is when a function calls itself to solve smaller instances of the same problem. Ex code:- def factorial_rec(n): if n == 0 or n == 1: return 1 return n * factorial_rec(n &mdash; 1) It’s clean for problems that are naturally recursive—like tree traversals or calculating Fibonacci numbers. -**Recursion vs. Iteration – Key Differences** _Feature_ ...

Полный текст и комментарии »

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

107.
Автор iamdumb, 12 лет назад, По-английски
Divide and conquer--More question hello you awesome people.I am studying divide and conquer technique nowadays.I am not getting in what scenario i have to use it.I have seen few algorithms like sorting(merge,quick),searching(binary) and few more..still i am not getting how to make my own divide and conquer algorithm for questions like finding largest element of array,maximum subset sum,multiplying polynomials,etc.. My few doubts 1) In what scenarios/problems Do i force myself to think Divide and conquer way ? 2) How to frame my own divide and conquer solution ? I will be Obliged.Please Help.
? 2) How to frame my own divide and conquer solution ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +9
  • Проголосовать: не нравится

108.
Автор sergio22, история, 3 месяца назад, По-английски
Yu-Gi-Oh! Codeforces Stats Hello Codeforces! I'd like to share a small project I built with a friend: a website that turns your Codeforces profile into a Yu-Gi-Oh! card, based on your rating and stats. The card frame changes depending on your rating tier, the number of stars reflects your max rank, and other stats like attack/defense scale with your performance too. Check it out here: https://yu-gi-oh-codeforces-stats.vercel.app/ If you like it, feel free to leave a star on the GitHub repo :) https://github.com/SJopez/Yu-Gi-Oh-Codeforces-Stats
profile into a Yu-Gi-Oh! card, based on your rating and stats. The card frame changes depending on your, your Codeforces profile into a Yu-Gi-Oh! card, based on your rating and stats. The cardframe

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

109.
Автор Sattwik, история, 5 лет назад, По-английски
TRY THIS QUESTION WHICH I COULD FRAME FROM PAST CONTEST **INITIALLY YOU ARE GIVEN TWO STRINGS S AND T OF LOWER CASE LATIN WORDS. YOU CAN REPLACE ANY CHARACTER OF S WITH STRING T,ANY NUMBER OF TIMES . YOU APPLY THE SAME PROCEDURE ON THE NEW STRING FORMED BY REPLACING A CHARACTER . LET S=s1,s2,s3,s4...sn (si is the ith character) and T = "ab". THEN YOU CHANGE s1-->T . HENCE new string becomes ab,s2,s3,s4...sn. Now you can further change any character of this new string with T . NOW YOU HAVE TO FIND THE TOTAL NUMBER OF UNIQUE STRINGS YOU CAN CREATE BY DOING THE ABOVE PROCESS ANY NUMBER OF TIMES(POSSIBLY ZERO). #### SOME EXAMPLES : S="abc" T ="dk" output =-1 since [dkbc,ddkbc,ddkbdc,.....infinte newstrings can be created] s="abc" T="x" output =8 since[abc,abx,axb,xbc,axx,xxc,xbx,xxx] s="aab" T="ab" output=-1 since[aaab,aaaab,.....infinite new strings can be created] s="ab" T="d" output=4 since[ab,ad,bd,dd] ###### **
TRY THIS QUESTION WHICH I COULD FRAME FROM PAST CONTEST

Полный текст и комментарии »

  • Проголосовать: нравится
  • -18
  • Проголосовать: не нравится

110.
Автор Ollie, история, 9 лет назад, По-английски
In-depth editorial for 811C I did the round #416 as a virtual contest but I didn't quite manage to solve problem C during the time frame. It took me a while but eventually I realized how the O(n^2) DP solution for it works so I thought I'd write a breakdown of the problem for anyone who tried to code it and failed. The example code is in C++11 but it's mostly just images and text. Hopefully it helps someone! https://competitive-programming-for-dummies.quora.com/In-depth-Codeforces-811C
time frame. It took me a while but eventually I realized how the O(n^2) DP solution for it works so

Полный текст и комментарии »

  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

111.
Автор live_like_simple, история, 5 лет назад, По-английски
How to solve this problem? you are given a number of easy, medium, and hard questions.also given the totalnumber of qns to be framed. following condition to be withheld while solving: medium qns always greater than easy and hard no two question-level should be consecutive. atleast one qns of every level must be there. input like N,E,M,H 4 2 3 3 output : total combination would be 4 e m h m , h m e m , m e m h, m h m e i don't know to approach this qns. thanks in advance!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

112.
Автор cheapmacmakeupul, 13 лет назад, По-английски
The internship program builds real world experience Metal Cheap Mac Eye Pencil bed frames <a href="http://maccosmeticssupplier.com/cheap-mac-lipstick-c-29.html">Cheap Mac Lipstick</a> are well-known because they are Mac Eyeliner Gel durable and they're subjected to sustain simply. I am Components Electronic suppliers writer, reports some information about garmin gpsmap 60 Dior Cosmetics gps , tom tom go 710. A wide variety of quality cheap foundation can be found in the skin care market but more often than not most of us are not sure which one we should buy. Born in Piacenza in 1934, Armani started his career as a modest window dresser, but soon established himself as a well-known fashion designer. First, a powerful way for a brand to be useful in the virtual world is to confer social importance on its users. While Inte users less overall attention, the <a href="http://maccosmeticssupplier.com/">maccosmeticssupplier.com</a> Cheap Chanel Makeup Nivea and Olay L'Oreal in Paris, ranked only fourth place, but the coincidence degree sear...

Полный текст и комментарии »

  • Проголосовать: нравится
  • -21
  • Проголосовать: не нравится

113.
Автор overloding, 5 лет назад, По-английски
Need Suggestion in DP DP is one of my favorite topics, and I'm very comfortable in Recursive DP (I can easily think of states and recursion, at least in easy-medium problems Codeforces 1600-1700 level). Still, when it comes to iterative DP, I can not frame solutions correctly, even easier problem, which I can do recursively very easily. Many people say we should shift to iterative DP, so what should I do? Should I continue practicing recursive more or shift to iterative (if so, please suggest how)
comes to iterative DP, I can not frame solutions correctly, even easier problem, which I can do

Полный текст и комментарии »

  • Проголосовать: нравится
  • +6
  • Проголосовать: не нравится

114.
Автор contactcodezine, история, 6 лет назад, По-английски
Basic of Developing computer games in Pygame Creating computer games or learning it required a lot of programming language and often starts from the basics. This process is done in a slow way. [pygame](https://thecodezine.com) can be a wonderful method for starting in [python](https://thecodezine.com/category/python/) through which you can learn how to write games and other graphical programs. A primer in a pregame assumes that you had a basics understanding of writing python games including its functions, loops, imports, and conditionals. You had to be familiar with the basics of learning. Mostly pygame works with most versions of python. What are pygame and its setup? ------------------------------ Pygame is an open-source platform for creating and developing games using python. It used the SDL library (simple direct media layer) which provides certain multimedia hardware components such as a mouse, video, joystick, and key. Pip is the best method for installing pygame. - To install use the pip command - After that, you ...
updating display and audio, processing user input, and maintaining a speed of the game. Aframe is known, , and maintaining a speed of the game. A frame is known as the cycle in the game loop and every

Полный текст и комментарии »

  • Проголосовать: нравится
  • -38
  • Проголосовать: не нравится

115.
Автор MorganStrikes, история, 3 месяца назад, По-английски
Need tips for solving 1400 rated problems I have solved mostly upto 1300x ... was able to solve a 1300 rated problem by 30-35min (sometimes 10-15 min if easy pattern) , so now i started solving 1400 rated ones, its been some days only but i am finding them a bit hard, had to see editorial/hint for almost all i solved (only 7 yet though) ... They are very observation based ig but i jump quickly into construction and coding as soon as i think i framed an approach.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -4
  • Проголосовать: не нравится

116.
Автор mdael.ali, история, 31 час назад, По-английски
FocusAI: an open-source attention companion for online lessons FocusAI helps a teacher see how a class is doing during an online lesson, without watching anyone. - How it works: a student opens a join link, reads a consent screen, and agrees. The student's browser analyses the webcam on their own device, with models that run locally in WebAssembly. - What the teacher sees: a status word such as "attentive" or "looking elsewhere", a 0-100 score, and a timeline. Statuses are encrypted end to end to the teacher's browser. - What doesn't leave the device: video, frames, and facial landmarks. - What it isn't: FocusAI is not a proctoring tool and must not be used for grading or discipline. The labels describe where a head and eyes were pointed. - Open source: the code is MIT-licensed at https://github.com/mdaelali/focusai . Privacy page: https://myfocusai.app/#/privacy I'd welcome feedback, especially on privacy and security. It hasn't had an independent audit yet.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -3
  • Проголосовать: не нравится

117.
Автор Racism_against_Newbie, история, 5 лет назад, По-английски
Why not more and more Div 4 and 3? I have seen a lot of blogs recently saying that why more and more div 4 and div 3 rounds are being conducted. I would like to suggest codeforces to conduct all rounds and just increase the frequency of rounds. It will satisfy the needs of all rating. And I think that the questions asked in Div 4 doesn't take a lot of time to frame. So, Yeah, Codeforces should definitely increase the frequency of rounds.
doesn't take a lot of time to frame. So, Yeah, Codeforces should definitely increase the frequency of

Полный текст и комментарии »

  • Проголосовать: нравится
  • -42
  • Проголосовать: не нравится

118.
Автор yshen94, история, 2 года назад, По-английски
problem installing brew on MacOS The problem appears to be: ==> Downloading and installing Homebrew... fatal: unable to access 'https://github.com/Homebrew/brew/': Error in the HTTP2 framing layer Failed during: /usr/bin/git fetch --quiet --progress --force origin How the problem is solved: https://github.com/orgs/Homebrew/discussions/668

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

119.
Автор kingkong1, история, 6 лет назад, По-английски
Checker of Multiple possible solutions Hey everyone, As we all know there are many problems on various websites which is having multiple possible solution. For a problem with single solution it is quite easy to make input and output files but I was having a question which consists of several possible solutions but I could not frame that problem completely as I tried to make a checker file that checks for all possible solutions which are satisfying the given conditions but couldn't do so. So can someone help me with it. Any kind of help is aprreciated :) Thank you
files but I was having a question which consists of several possible solutions but I could notframe, having a question which consists of several possible solutions but I could not frame that problem

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится