mzhang2021 / cp-blog Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hey everyone, it’s been too long since I last took the time to sit down and write a blog post. There’s a multitude of reasons why I haven’t written anything lately. Mainly, once college started, any time to devote to CP instantly evaporated thanks to classes, clubs, and socializing. But also, I just didn’t have anything to write. Typically, when I write a blog post, I write with some topic or intent in mind, usually to educate or as an opinion piece. I’ve started a number of drafts for my next article but have tentatively scrapped all of them, simply because I realized midway that I either didn’t have too much to say or I didn’t feel qualified enough to write on the subj
Segment tree merging often serves as an alternative to small-to-large while also cutting an extra log factor, or can be used for “directed” merging (i.e. the merging is not symmetric w.r.t. both sets). The extent to which this technique can be applied is actually quite extensive, and a lot of it is not documented in English (the only English resource I’ve found is this cf post), so I hope to bridge the gap with this post.
It’s been a month since my last major milestone in CP, and high time for some self reflection. There are two major CP competitions I competed in this month: Facebook Hacker Cup, and Kotlin Heroes 8.
Divide and conquer (D&Q for short) is a common and powerful problem solving paradigm in the world of algorithms. There are numerous well-known examples such as merge sort and fast Fourier transform, and in this article I will cover some (maybe less common) applications of D&Q that are more specific to competitive programming. The sections progress from simple to complex, so more experienced competitors can skip to a later section of the article.
Hooray, it’s my first post of October, meaning I’ve kept this blog running for at least a month!
I love maintaining a competitive programming library. You get to implement things attuned to your own personal style, and it’s super satisfying when you use something from your library to successfully pass a problem. There’s also just something satisfying about working on a project over a long period of time, and having it grow and evolve alongside your CP journey. I started my library 3 years ago1 in high school, and it’s come a long way since then. And so now, I write this article so that I can plug my library explain how I design my implementations and how they integrate into my setup. If you check the stats for my Github repo, it was created in February 2020, but that was only the date wh
This past weekend, I attended my first ever ICPC regionals! It was an incredibly fun and enlightening experience for me, so I’d like to share with you some takeaways I had.
It’s been a while, but I’m back with some more estoric knowledge! Historic information is a concept I’ve only seen briefly mentioned in this tutorial on segment tree beats, and the section only covers one example of it, so I’ll cover some more examples in this article.
Short contests are fun, although not without its fair share of frustrating moments. Have you ever come so close to solving a problem, but ran out of time? If only you had 10 extra minutes! Or have you ever “bricked” on a problem? That is, you come across a problem that should be within your rating range and easily solved, but you just can’t think of the trick needed to solve it? This has happened to me many times, with the most recent example being Global Round 15. I could not think of how to get past the naive
Berlekamp-Massey is a powerful tool that can knock out almost all linear recurrence problems, but it’s often explained in the context of BCH decoding in many online tutorials, making it difficult to understand in a more general sense. There’s TLE’s Codeforces blog, which contains all the core concepts of the algorithm but is a bit terse in my opinion. There’s also Massey’s paper, which is more on the mathematically rigorous side, and I have incorporated some of Massey’s proofs into the proof section of this article. The goal of this article is to explain Berlekamp-Massey using my intuition/understanding of it.
When we think about the classic model for dynamic programming, typically we think about first enumerating the state, and then enumerating the transitions from that state. But sometimes that perspective doesn’t yield itself to a sufficiently fast solution. Let’s look at some examples.
I’ve seen numerous problems recently where the solution comes from a shift in perspective, and I’ve found them amusing enough to write a whole blog around this topic. I wouldn’t consider this a technique but rather just an explanation of visual intuition for problem solving.
Welcome to my blog! I go by smax on Codeforces and most other competitive programming sites, and this is a fun personal project for me that I’ve always wanted to do. On this blog, I’ll post articles about techniques, tricks, opinions, or pretty much anything remotely related to CP. Do check it out if you’re interested. This site is powered by Jekyll and the “Mediumish” theme, so if you like how the site looks be sure to check those out.
SPOJ has a series of problems with problem codes GSS1, GSS2, …, GSS8. The problems are intended as educational range query problems, and while they are a bit outdated, they can still be interesting to work through and think about. I highly recommend thinking about each problem on your own before looking at the editorial. Also, don’t feel the need to go in order, because they are definitely not ordered by difficulty. Finally, while I might include snippets of code for clarity of explanation, writing the full code for each problem will be left as an exercise to the reader :)
Just go to the comment section of any announcement blog for a contest, and you’ll likely see a comment like “A < C < B” or “E was much easier than D.” Or look at any leaderboard, and there’s always at least a few contestants who solve the problems out of order or skip some problem. Problem difficulty is a very subjective thing, and it’s always near impossible to create a set of problems such that A is strictly easier than B, which is strictly easier than C, and so on. Why is that the case, and what makes a problem difficult?
Yay the blog has been revived!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.