You are not logged in. Please login at www.codechef.com to post your questions!

×

[closed] Help me please ZCO is approaching

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

asked 06 Nov '16, 11:45

coder_voder's gravatar image

2★coder_voder
593331
accept rate: 8%

closed 14 Dec '16, 21:00

The question has been closed for the following reason "Other" by coder_voder 14 Dec '16, 21:00


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.

link

answered 17 Nov '16, 16:52

diveshuttam's gravatar image

3★diveshuttam
53718
accept rate: 27%

edited 17 Nov '16, 20:07

Can you please categorize the ZCO previous years problems?

(18 Nov '16, 20:00) coder_voder2★
2

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.

(19 Nov '16, 00:41) diveshuttam3★

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 :P

link

answered 16 Nov '16, 22:06

aneesh2312's gravatar image

5★aneesh2312
49438
accept rate: 8%

http://www.geeksforgeeks.org/top-algorithms-and-data-structures-for-competitive-programming/ you can learn these things but 3 days are quiet less for that so i suggest just learn top 3 or 4 algos

link

answered 16 Nov '16, 22:29

shivshankar8's gravatar image

4★shivshankar8
612
accept rate: 25%

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 <typename t=""> 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<typename t=""> 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<int> 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

link

answered 17 Nov '16, 15:20

bansal1232's gravatar image

5★bansal1232
2.8k1418
accept rate: 16%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,698
×423

question asked: 06 Nov '16, 11:45

question was seen: 1,362 times

last updated: 14 Dec '16, 21:00