0% found this document useful (0 votes)
55 views2 pages

Competitive Programming 3: 1.2 Tips To Be Competitive

hi

Uploaded by

Andrew T
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views2 pages

Competitive Programming 3: 1.2 Tips To Be Competitive

hi

Uploaded by

Andrew T
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Competitive Programming 3

1 Introduction
1.2 Tips to be Competitive
1.2.1 Type Code Faster
Aim for 85-95 wpm. Familiarise with programming symbols
1.2.2 Quickly Identify Problem Types

1.2.3 Do Algorithm Analysis


Modern computers can process up to 100M (million) processes in a few seconds.
 Basic time and space complexity analysis for iterative and recursive algorithms:
o Algorithm with k-nested loop of n iterations has O(nk) complexity
o Recursive algorithm with b recursive calls per level and L levels has O(bL) complexity as
upper bound
o Dynamic Programming algo that processed 2D n x n matrix in O(k) per cell runs in O(k x n2)
time
 More advanced analysis techniques:
o Prove the correctness of an algorithm (especially for Greedy algorithms in Section 3.4), to
minimize your chance of getting the ‘Wrong Answer’ verdict.
o Perform the amortized analysis (e.g. see Chapter 17 of [7])—although rarely used in
contests—to minimize your chance of getting the ‘Time Limit Exceeded’ verdict, or worse,
considering your algorithm to be too slow and skips the problem when it is in fact fast
enough in amortized sense.
o Do output-sensitive analysis to analyze algorithm which (also) depends on output size and
minimize your chance of getting the ‘Time Limit Exceeded’ verdict.
 Familiarity with bounds
o If you need to store integers ≥ 264, use the Big Integer technique (Section 5.3).
o There are n! permutations and 2n subsets (or combinations) of n elements.
o Usually, O(n log2 n) algorithms are sufficient to solve most contest problems.
o The largest input size for typical programming contest problems must be < 1M. Beyond that,
the time needed to read the input (the Input/Output routine) will be the bottleneck.
1.2.4 Master Programming Languages

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy