Popular posts from this blog
Number theory Part-2
Introduction Problems in competitive programming which involve Mathematics are are usually about number theory, or geometry. If you know number theory, that increases your ammo heavily in solving a lot of tougher problems, and helps you in getting a strong hold on a lot of other problems, too. Problems in competitive programming require insight, so just knowing some topics is not enough at all. All of the problems requires more or less math tough. For instance, solving large systems of equations and approximating solutions to differential equations. Set Theory Before we proceed, let us get through the some common set operations. Q.) What is a Set? -In mathematics, a set is a collection of distinct objects, considered as an object in its own right. For example, the numbers 2, 4, and 6 are distinct objects when considered separately, but when they are considered collectively they form a single set of size three, written {2,4,6}. Sets are one of the most fundamental concept
HOT UPDATE: Added tricks about REGEX, Raw Strings, User-defined Literals. As a whole new section! WARNING: Many of these things belong to C++11 so use C++11 in order to test anything here :) I just write a short version for this article, because it's now in the main page. I recommend you to click on "Read more »" and read more :) Here is a short trick for the short version: I see lots of programmers write code like this one: pair < int , int > p ; vector <int> v ; // ... p = make_pair ( 3 , 4 ); v . push_back ( 4 ); v . push_back ( 5 ); while you can just do this: pair < int , int > p ; vector <int> v ; // ... p = { 3 , 4 }; v = { 4 , 5 }; 1. Assign value by a pair of {} to a container I see lots of programmers write code like this one: pair < int , int > p ; // ... p = make_pair ( 3 , 4 ); while you can just do this: pair < int , int > p ; // ... p = { 3 , 4 }; even a more complex
Comments
Post a Comment