SlideShare une entreprise Scribd logo
1  sur  18
COMPETITIVE PROGRAMMING Ishani Parekh
What is it ? Writing programs to solve problems in a contest environment.  One has limited time to solve problems. Ranging from a few hours to a few days.  Team participation or Individual.
What do these contests test ? Algorithm Skills (Must !) Basic Math Skills Programming Skills Speed (Good typing speed helps) Creativity Debugging Skills (For challenge phase)
Some Prestigious contests ACM – ICPC Google Code Jam Topcoder Open Facebook Hacker Cup (Recent)
ACM - ICPC It is like the Olympics for Programming. Students who win these contests are some of the finest brains in the world and are instantly recognized by top institutions (companies, academia)
Rules -1 Online Contest - National level (around 1000 teams) Onsite Contest - National level (around 130 teams) World Finals (around 2-3 teams selected from India)
Rules - 2 Team Contest (max size:3) Languages : C/C++/Java Time : 5 hrs One machine Set of around 10 problems. Ranking is based on number of problems solved with penalty for wrong submissions.
What do you gain? Improve your logical and analytical skills. Good point to mention in CV. Improve your network of friends who are also interesting in programming. Recognition. Most importantly, have fun. Onsite contests also plan excursions.
Where to practice Topcoder (highly recommended) SPOJ  Codeforces Codechef UVa USACO
A Typical Problem http://www.spoj.pl/problems/AGGRCOW/ Problem Statement Input Output Constraints (you don’t check for this. It will be satisfied by the input) Time Limit (typically ~10^7 operations under 1s) Memory Limit (typically 64 MB at runtime)
Contest System Each problem has a problem setter. He writes the problem, generates input test cases and their corresponding correct outputs. Your program takes input and generates output in the format specified in the problem. Outputs of your program will be compared with the correct outputs.
Responses from the judge http://www.spoj.pl/status/ Accepted Wrong Answer Time Limit Exceeded Compilation error Segmentation fault (SIGSEGV) … …
Tips for good performance Maintain pre-written templates for Standard algorithms  Necessary headers, functions etc. (eg. all #includes and macros in c++) Indent your code  If you use Vim editor, configure your .vimrc file for your programming language. Use the visual mode to indent code.
Tips for good performance Use functions/methods wherever possible to avoid repetition of code. Solve the problem on paper first. Then only code.  Write test cases for the problem and test your logic and program with those test cases before submitting.  Test your program for the worst case. Use “time” command to check the running time of your programs in linux.
Tips for good performance Know the contest rules before you compete. Take risks and don’t panic . Read contest editorials/explanations after the contest is over.  Solve your questions by Thinking yourself or searching the internet. Asking friends. Visiting forums.
Resources Topcoder Tutorials Topcoder Forums Google Code Jam Codechef  Wiki
Demo Topcoder Arena.

Contenu connexe

En vedette

Workshop on programming contest
Workshop on programming contestWorkshop on programming contest
Workshop on programming contestAbir Khan
 
On the Parallel Complexity of Minimum Sum of Diameters clustering
On the Parallel Complexity of Minimum Sum of Diameters clusteringOn the Parallel Complexity of Minimum Sum of Diameters clustering
On the Parallel Complexity of Minimum Sum of Diameters clusteringNopadon Juneam
 
Bitfusion Nimbix Dev Summit Heterogeneous Architectures
Bitfusion Nimbix Dev Summit Heterogeneous Architectures Bitfusion Nimbix Dev Summit Heterogeneous Architectures
Bitfusion Nimbix Dev Summit Heterogeneous Architectures Subbu Rama
 
Bitfusion Overview Tensorflow Meetup
Bitfusion Overview Tensorflow MeetupBitfusion Overview Tensorflow Meetup
Bitfusion Overview Tensorflow MeetupSubbu Rama
 
Cdma introduction pr
Cdma introduction prCdma introduction pr
Cdma introduction prsharmasantosh
 
3d passwords
3d passwords3d passwords
3d passwordsshwetaag
 
Basic Problems and Solving Algorithms
Basic Problems and Solving AlgorithmsBasic Problems and Solving Algorithms
Basic Problems and Solving AlgorithmsNopadon Juneam
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of AlgorithmsSwapnil Agrawal
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)jehan1987
 
Modeolo carta de solicitud de proyectos
Modeolo carta de solicitud de proyectosModeolo carta de solicitud de proyectos
Modeolo carta de solicitud de proyectosduberlisg
 
Carta de permiso al director
Carta de permiso al directorCarta de permiso al director
Carta de permiso al directorRichard González
 

En vedette (18)

Web development
Web developmentWeb development
Web development
 
Spyware
SpywareSpyware
Spyware
 
Workshop on programming contest
Workshop on programming contestWorkshop on programming contest
Workshop on programming contest
 
On the Parallel Complexity of Minimum Sum of Diameters clustering
On the Parallel Complexity of Minimum Sum of Diameters clusteringOn the Parallel Complexity of Minimum Sum of Diameters clustering
On the Parallel Complexity of Minimum Sum of Diameters clustering
 
Bitfusion
BitfusionBitfusion
Bitfusion
 
Orientation
OrientationOrientation
Orientation
 
Bitfusion Nimbix Dev Summit Heterogeneous Architectures
Bitfusion Nimbix Dev Summit Heterogeneous Architectures Bitfusion Nimbix Dev Summit Heterogeneous Architectures
Bitfusion Nimbix Dev Summit Heterogeneous Architectures
 
Bitfusion Overview Tensorflow Meetup
Bitfusion Overview Tensorflow MeetupBitfusion Overview Tensorflow Meetup
Bitfusion Overview Tensorflow Meetup
 
3D password
3D password3D password
3D password
 
Cdma introduction pr
Cdma introduction prCdma introduction pr
Cdma introduction pr
 
3d passwords
3d passwords3d passwords
3d passwords
 
Basic Problems and Solving Algorithms
Basic Problems and Solving AlgorithmsBasic Problems and Solving Algorithms
Basic Problems and Solving Algorithms
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)
 
3d password ppt
3d password ppt3d password ppt
3d password ppt
 
Modeolo carta de solicitud de proyectos
Modeolo carta de solicitud de proyectosModeolo carta de solicitud de proyectos
Modeolo carta de solicitud de proyectos
 
Vizify-tech seminar ppt
Vizify-tech seminar pptVizify-tech seminar ppt
Vizify-tech seminar ppt
 
Carta de permiso al director
Carta de permiso al directorCarta de permiso al director
Carta de permiso al director
 

Dernier

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Dernier (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Competitive programming

  • 2. What is it ? Writing programs to solve problems in a contest environment. One has limited time to solve problems. Ranging from a few hours to a few days. Team participation or Individual.
  • 3. What do these contests test ? Algorithm Skills (Must !) Basic Math Skills Programming Skills Speed (Good typing speed helps) Creativity Debugging Skills (For challenge phase)
  • 4. Some Prestigious contests ACM – ICPC Google Code Jam Topcoder Open Facebook Hacker Cup (Recent)
  • 5.
  • 6. ACM - ICPC It is like the Olympics for Programming. Students who win these contests are some of the finest brains in the world and are instantly recognized by top institutions (companies, academia)
  • 7. Rules -1 Online Contest - National level (around 1000 teams) Onsite Contest - National level (around 130 teams) World Finals (around 2-3 teams selected from India)
  • 8. Rules - 2 Team Contest (max size:3) Languages : C/C++/Java Time : 5 hrs One machine Set of around 10 problems. Ranking is based on number of problems solved with penalty for wrong submissions.
  • 9. What do you gain? Improve your logical and analytical skills. Good point to mention in CV. Improve your network of friends who are also interesting in programming. Recognition. Most importantly, have fun. Onsite contests also plan excursions.
  • 10. Where to practice Topcoder (highly recommended) SPOJ Codeforces Codechef UVa USACO
  • 11. A Typical Problem http://www.spoj.pl/problems/AGGRCOW/ Problem Statement Input Output Constraints (you don’t check for this. It will be satisfied by the input) Time Limit (typically ~10^7 operations under 1s) Memory Limit (typically 64 MB at runtime)
  • 12. Contest System Each problem has a problem setter. He writes the problem, generates input test cases and their corresponding correct outputs. Your program takes input and generates output in the format specified in the problem. Outputs of your program will be compared with the correct outputs.
  • 13. Responses from the judge http://www.spoj.pl/status/ Accepted Wrong Answer Time Limit Exceeded Compilation error Segmentation fault (SIGSEGV) … …
  • 14. Tips for good performance Maintain pre-written templates for Standard algorithms Necessary headers, functions etc. (eg. all #includes and macros in c++) Indent your code If you use Vim editor, configure your .vimrc file for your programming language. Use the visual mode to indent code.
  • 15. Tips for good performance Use functions/methods wherever possible to avoid repetition of code. Solve the problem on paper first. Then only code. Write test cases for the problem and test your logic and program with those test cases before submitting. Test your program for the worst case. Use “time” command to check the running time of your programs in linux.
  • 16. Tips for good performance Know the contest rules before you compete. Take risks and don’t panic . Read contest editorials/explanations after the contest is over. Solve your questions by Thinking yourself or searching the internet. Asking friends. Visiting forums.
  • 17. Resources Topcoder Tutorials Topcoder Forums Google Code Jam Codechef Wiki