SlideShare a Scribd company logo
By – Siddhant saxena
What is it?
Writing programs to solve problems in a contest
environment.
One has a limited time to solve the problems.
Ranging from a few hours to a few days.
The solution should be efficient in terms of execution
time, memory used or in some cases even the length
of code.
What’s new?
The code will be executed on an Online Judge (OJ).
 Which means you should write code which conforms to the
specific format of input and gives the output in the required
format.
 With tough constraints on execution time, it is crucial that
you use faster algorithms to avoid TLE(s) on your test cases.
 This requires a good knowledge of time complexities
Data Structure can be defined as the group of data elements which provides an efficient way of
storing and organizing data in the computer so that it can be used efficiently. Some examples of
Data Structures are arrays, Linked List, Stack, Queue, etc. Data Structures are widely used in
almost every aspect of Computer Science i.e. Operating System, Compiler Design, Artificial
intelligence, Graphics and many more.
Intuition of Data Structures
Understanding the input
format
•Input on OJ’s is very straightforward. You don’t
need to prompt for it like we usually do.
 The first line of input is usually the number of test
cases, followed by the test cases.
Program for Fibonacci numbers
Last Updated: 18-11-2020
The Fibonacci numbers are the numbers in the following
integer sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..
In mathematical terms, the sequence Fn of Fibonacci numbers
is defined by the recurrence relation
Fn = Fn-1 + Fn-2
with seed values
F0 = 0 and F1 = 1.
Getting started with competitive coding:
Solving the problems in a coding contest is not easy. Many online judges have problems of
similar difficulty and similar environment. A list of such judges are:-
1. TopCoder
2. SPOJ
3. Codechef
4. HackerEarth
5. HackerRank
6. Codeforces
And many more…
A few tips to perform better:
Have a thorough
grasp on the
basic concepts
first.
Develop a good
understanding
of data
structures like
lists, trees and
graphs.
Try to learn as many
new and efficient
algorithms and
implement them
when required.
CP Handbook :- https://cses.fi/book/book.pdf
Some
prestigious
contests:
1. ACM – ICPC
2. Google Code Jam
3. Topcoder Open
4. Facebook Hacker Cup (Recent)
Students who perform well in these contests are some of the
finest brains in the world and instantly recognized by top
institutions (companies, academia).
What’s next?
Sign up on any of the plethora of online judges and start solving
their practice problems.
You will run into a lot of errors in the beginning.
Also, participate in other online contests arranged by sites like
codechef and SPOJ.
Many companies use these contests to hire students for jobs
and internships as well.

More Related Content

PDF
Assignment # 3 computer system and Programming EC-105
PDF
Machine Learning
PDF
Specific study objectives for part 1
DOCX
WORKSHOP ENGINEERING COLLEGES IN ECE- workshop on embedded system programming
DOC
Introduction to IT
PPTX
11 Unit 1 Problem Solving Techniques
PDF
Intro to machine learning
DOCX
Lesson Plan
Assignment # 3 computer system and Programming EC-105
Machine Learning
Specific study objectives for part 1
WORKSHOP ENGINEERING COLLEGES IN ECE- workshop on embedded system programming
Introduction to IT
11 Unit 1 Problem Solving Techniques
Intro to machine learning
Lesson Plan

What's hot (6)

PPT
Problem Solving Techniques
PDF
Ml introduction
PPTX
What is algorithm
PPTX
Intro to machine learning(with animations)
DOC
Mca 107
PPTX
supervised learning
Problem Solving Techniques
Ml introduction
What is algorithm
Intro to machine learning(with animations)
Mca 107
supervised learning
Ad

Similar to Introduction to cp (20)

PPT
An introduction to Competitive Programming
PPTX
Introduction-to-Coding-Challenges data structure.pptx
PPTX
Introduction-to-Coding-Challenges in data structure.pptx
PPTX
Competitive Programming
PPT
Acm icpc-briefing-prof-nbv
PPTX
Kickstart to Competitive programming .P.pptx
PPTX
Data Structures and Algorithms Made Easy
PPTX
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
PDF
CP tips and tricks.pdf
PDF
Elements of Programming Interviews.pdf
PDF
guide-t-cp.pdf programming book will help to
PPTX
DSA unpluggedEventByGDGOncampusAtMedcaps.pptx
PDF
(SOS) Lipschutz, Seymour - Data Structures-McGraw Hill Education (2014).pdf
DOC
PPT
CS3114_09212011.ppt
PPT
Data Structure and Algorithms Department of Computer Science
PDF
Nguyễn Nho Vĩnh - Problem solvingwithalgorithmsanddatastructures
PPT
III_Data Structure_Module_1.ppt
PDF
Unit-I-DAA.pdf
PPTX
Cracking the coding interview u penn - sept 30 2010
An introduction to Competitive Programming
Introduction-to-Coding-Challenges data structure.pptx
Introduction-to-Coding-Challenges in data structure.pptx
Competitive Programming
Acm icpc-briefing-prof-nbv
Kickstart to Competitive programming .P.pptx
Data Structures and Algorithms Made Easy
a581a6a2cb5778045788f0b1d7da1c0236f.pptx
CP tips and tricks.pdf
Elements of Programming Interviews.pdf
guide-t-cp.pdf programming book will help to
DSA unpluggedEventByGDGOncampusAtMedcaps.pptx
(SOS) Lipschutz, Seymour - Data Structures-McGraw Hill Education (2014).pdf
CS3114_09212011.ppt
Data Structure and Algorithms Department of Computer Science
Nguyễn Nho Vĩnh - Problem solvingwithalgorithmsanddatastructures
III_Data Structure_Module_1.ppt
Unit-I-DAA.pdf
Cracking the coding interview u penn - sept 30 2010
Ad

Recently uploaded (20)

PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Cell Types and Its function , kingdom of life
PDF
01-Introduction-to-Information-Management.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Lesson notes of climatology university.
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
master seminar digital applications in india
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Institutional Correction lecture only . . .
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Sports Quiz easy sports quiz sports quiz
Cell Types and Its function , kingdom of life
01-Introduction-to-Information-Management.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
STATICS OF THE RIGID BODIES Hibbelers.pdf
Basic Mud Logging Guide for educational purpose
Renaissance Architecture: A Journey from Faith to Humanism
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Lesson notes of climatology university.
human mycosis Human fungal infections are called human mycosis..pptx
O5-L3 Freight Transport Ops (International) V1.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
master seminar digital applications in india
Microbial diseases, their pathogenesis and prophylaxis
Institutional Correction lecture only . . .
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf

Introduction to cp

  • 2. What is it? Writing programs to solve problems in a contest environment. One has a limited time to solve the problems. Ranging from a few hours to a few days. The solution should be efficient in terms of execution time, memory used or in some cases even the length of code.
  • 3. What’s new? The code will be executed on an Online Judge (OJ).  Which means you should write code which conforms to the specific format of input and gives the output in the required format.  With tough constraints on execution time, it is crucial that you use faster algorithms to avoid TLE(s) on your test cases.  This requires a good knowledge of time complexities
  • 4. Data Structure can be defined as the group of data elements which provides an efficient way of storing and organizing data in the computer so that it can be used efficiently. Some examples of Data Structures are arrays, Linked List, Stack, Queue, etc. Data Structures are widely used in almost every aspect of Computer Science i.e. Operating System, Compiler Design, Artificial intelligence, Graphics and many more. Intuition of Data Structures
  • 5. Understanding the input format •Input on OJ’s is very straightforward. You don’t need to prompt for it like we usually do.  The first line of input is usually the number of test cases, followed by the test cases.
  • 6. Program for Fibonacci numbers Last Updated: 18-11-2020 The Fibonacci numbers are the numbers in the following integer sequence. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, …….. In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation Fn = Fn-1 + Fn-2 with seed values F0 = 0 and F1 = 1.
  • 7. Getting started with competitive coding: Solving the problems in a coding contest is not easy. Many online judges have problems of similar difficulty and similar environment. A list of such judges are:- 1. TopCoder 2. SPOJ 3. Codechef 4. HackerEarth 5. HackerRank 6. Codeforces And many more…
  • 8. A few tips to perform better: Have a thorough grasp on the basic concepts first. Develop a good understanding of data structures like lists, trees and graphs. Try to learn as many new and efficient algorithms and implement them when required. CP Handbook :- https://cses.fi/book/book.pdf
  • 9. Some prestigious contests: 1. ACM – ICPC 2. Google Code Jam 3. Topcoder Open 4. Facebook Hacker Cup (Recent) Students who perform well in these contests are some of the finest brains in the world and instantly recognized by top institutions (companies, academia).
  • 10. What’s next? Sign up on any of the plethora of online judges and start solving their practice problems. You will run into a lot of errors in the beginning. Also, participate in other online contests arranged by sites like codechef and SPOJ. Many companies use these contests to hire students for jobs and internships as well.