Please someone can help me on what should i study in these 3 days please list me the Data Structures & Algorithms that is frequently asked in ZCO and link to some Resources that would be useful for me in preparation of ZCO
:: What i know already ::
1 Basics of Programming in C & C++
2 Some useful stl stuff for example __gcd, sort, binary_search. It would be nice if any of you can list some more useful STL stuff which would be helpful for me for preparation of ZCO
3 Searching & Sorting
Usually there is one question on Dynamic Programming AFAIK… But becoming good in dp in 3 days is very difficult…
lower_bound() and upper _bound() functions are also quite useful and I suggest learning their usage as well.
PS.: I am no expert
you can learn these things but 3 days are quiet less for that so i suggest just learn top 3 or 4 algos
built in function of C++, Usefull for binary manupulation like…
Number of leading zeroes: builtin_clz(x)
Number of trailing zeroes : builtin_ctz(x)
Number of 1-bits: __builtin_popcount(x)
Fpr fast Input and output use
FOR INPUT
template inline void fi(T &a) { register char c=0; while (c<33) c=getchar(); a=0; int tmp = 0; while (c>33) { if ( c == 45 ) tmp = 1; else a=a*10+c-‘0’; c=getchar(); } if ( tmp == 1 ) a = 0-(a); }
FOR OUTPUT
template void outpos(T n){if(n<0){outchar(’-’);n*=-1;}char snum[65];int i=0;do {snum[i++]=n%10+‘0’;n/=10;}
while(n);i=i-1;while(i>=0)outchar(snum[i–]);outchar(’\n’);}
use range based loop like–
std::vector v = {0, 1, 2, 3, 4, 5};
for (const int& i : v) // access by const reference
std::cout << i << ' ';
std::cout << '\n';
for (auto i : v) // access by value, the type of i is int
std::cout << i << ' ';
Output
0 1 2 3 4 5
0 1 2 3 4 5
Hi @coder_voder. I participated in ZCO 2k14. here are few of the things which i found important.
Firstly STL docs are provided as reference during the contest so you must not worry much about their syntax but yes stacks and queues from stl are most important parts during coding algorithms and even in ad-hoc problems.You should try them atleast once if haven’t tried them before. STL sets/maps are important and can reduce you effort of programming trees and even can save your day.For details go to this link on topcoder.
Out of the two problems in ZCO if you are able to solve even one of them there are very high chances that you will qualify. So first look at both of the questions and then decide which one to code first.
And generally what i saw when i was preparing was that there are ad-hoc problems in zco once a while which are relatively easy to code as they don’t require any special algorithms ; you shouldn’t loose on them.
As part of algorithms that are asked in ZCO are all amongst the standard ones listed on Iarcs website. But as you have less time you should see the graph algorithms and dp.Mostly there is a question amongst them.
Finally wish you all the best.
Pls upvote if you find it helpful.
For any query comment below.
1 Like
Can you please categorize the ZCO previous years problems?
for 2016 first problem was based on sorting(in nlogn). second problem can be done in variety of approaches due to lower limits. i would have done it with simple loops which i will classify as ad-hoc but i saw solutions which used dp also.
Ps I am not very good at classifying these.
1 Like