SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Problem Solving on ACM
International Collegiate
Programming Contest
Fedor Tsarev, ACM ICPC World
Champion 2008
St. Petersburg University of IT,
Mechanics & Optics
18.10.2010
ETH Zurich
2
Epigraph
The whole is more than
the sum of its parts
(Aristotle)
3
Perfect Team
 Common code-style
(indents, variable naming,
…)
 Common patterns of
algorithm implementation
 Everyone should know
strong and weak points of
other members of the
team
4
Start of the Contest
 Write a template
 Read problem statements:
 Starting with the first
problem
 Starting with the last
problem
 Do not try to solve the first
problem you have read –
find the simplest problem
 Every member must know
his role at the start of the
contest
5
Problems Status
№ Member 1 Member 2 Member 3 Comments
A
+ Graph theory
B
+
C
+
D
+
…
6
One hour from the start of the
contest…
№ Member 1 Member 2 Member 3 Comments
A
+ Graph theory
B
+ + + KMP
C
+ + + DP over subsets
D
+ + + Geometry
…
+ + +
7
How to solve a problem
1. Read the statement carefully
2. Invent an algorithm
3. Discuss the algorithm with another member
of your team
4. Discuss the implementation with another
member of your team
5. Write a program
6. Test your solution
8
Submitting a Solution
 Save the source file before submitting
 Compile it
 Always test the solution on example tests and
on all tests you have:
 Corner cases
 Maximal tests (checking time limit and memory
limit)
 Print the source code after submitting (on the
official contest)
9
If your solution is not
accepted…
 … then you have a bug in the program 
 To find it carefully read the printout
 Never read the code from the screen
 If you find a bug do not fix it right now on the
computer – there are more bugs in the program
 Fix the bug in the printout
 Try to explain your code to another member of
your team
 Write a slower solution and stress-test with it
 …
10
Debugging
 Debugging is a very time-consuming process
 You do not create code while debugging
Avoid using debugger!
Read the printout instead
11
Programming in Pairs
 If the implementation is too difficult for you…
 If you are tired…
 If the code is large…
 Try programming in pairs:
 One of the team members writes the code
 Another one is looking for mistakes
 This idea is from eXtreme Programming
12
Last hour of the contest
 Your goal is to get “Accepted” for all
problems you have started
 Do not start new problems if you have “old”
ones
 If you do not have enough time for all
problems choose some of them
13
Log of the contest
 Only for trainings
 Helps you to analyze the results of the contest
Time Member 1 Member 2 Member 3
30 Wrote a template Read A, B, C, D.
Wrote solution for
B
Read F, G, H, I
60 … … …
… … … …
300 … … …
14
Thank you!
We wish you success in ACM
ICPC!

Weitere ähnliche Inhalte

Andere mochten auch

05 динамическое программирование
05 динамическое программирование05 динамическое программирование
05 динамическое программирование
Fedor Tsarev
 
11 x1 t14 06 sum of a geometric series (2012)
11 x1 t14 06 sum of a geometric series (2012)11 x1 t14 06 sum of a geometric series (2012)
11 x1 t14 06 sum of a geometric series (2012)
Nigel Simmons
 
13 3 arithmetic and geometric series and their sums
13 3 arithmetic and geometric series and their sums13 3 arithmetic and geometric series and their sums
13 3 arithmetic and geometric series and their sums
hisema01
 
Сборка генома: мифы и реальность. Доклад на пленарном заседании III Всероссий...
Сборка генома: мифы и реальность. Доклад на пленарном заседании III Всероссий...Сборка генома: мифы и реальность. Доклад на пленарном заседании III Всероссий...
Сборка генома: мифы и реальность. Доклад на пленарном заседании III Всероссий...
Fedor Tsarev
 

Andere mochten auch (11)

05 динамическое программирование
05 динамическое программирование05 динамическое программирование
05 динамическое программирование
 
05 динамическое программирование
05 динамическое программирование05 динамическое программирование
05 динамическое программирование
 
11 x1 t14 06 sum of a geometric series (2012)
11 x1 t14 06 sum of a geometric series (2012)11 x1 t14 06 sum of a geometric series (2012)
11 x1 t14 06 sum of a geometric series (2012)
 
13 3 arithmetic and geometric series and their sums
13 3 arithmetic and geometric series and their sums13 3 arithmetic and geometric series and their sums
13 3 arithmetic and geometric series and their sums
 
Advanced Search Techniques
Advanced Search TechniquesAdvanced Search Techniques
Advanced Search Techniques
 
Сборка генома: мифы и реальность. Доклад на пленарном заседании III Всероссий...
Сборка генома: мифы и реальность. Доклад на пленарном заседании III Всероссий...Сборка генома: мифы и реальность. Доклад на пленарном заседании III Всероссий...
Сборка генома: мифы и реальность. Доклад на пленарном заседании III Всероссий...
 
Unit v computer, number system
Unit  v computer, number systemUnit  v computer, number system
Unit v computer, number system
 
Geometric series
Geometric seriesGeometric series
Geometric series
 
Bisection
BisectionBisection
Bisection
 
Arithmetic Sequence and Arithmetic Series
Arithmetic Sequence and Arithmetic SeriesArithmetic Sequence and Arithmetic Series
Arithmetic Sequence and Arithmetic Series
 
ACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2014 NEERC (Northeastern European Regional Contest) Problems Review
 

Ähnlich wie Problem solving on acm international collegiate programming contest

Lecture 7 program development issues (supplementary)
Lecture 7  program development issues (supplementary)Lecture 7  program development issues (supplementary)
Lecture 7 program development issues (supplementary)
alvin567
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
John Choi
 

Ähnlich wie Problem solving on acm international collegiate programming contest (20)

midterm_fa07.pdf
midterm_fa07.pdfmidterm_fa07.pdf
midterm_fa07.pdf
 
Introduction.pptx
Introduction.pptxIntroduction.pptx
Introduction.pptx
 
Pair Programming
Pair ProgrammingPair Programming
Pair Programming
 
Big Java Chapter 1
Big Java Chapter 1Big Java Chapter 1
Big Java Chapter 1
 
Debugging
DebuggingDebugging
Debugging
 
Lecture 7 program development issues (supplementary)
Lecture 7  program development issues (supplementary)Lecture 7  program development issues (supplementary)
Lecture 7 program development issues (supplementary)
 
Software Design
Software DesignSoftware Design
Software Design
 
How to code
How to codeHow to code
How to code
 
Evolutionary Design - Refactoring Heuristics
Evolutionary Design - Refactoring HeuristicsEvolutionary Design - Refactoring Heuristics
Evolutionary Design - Refactoring Heuristics
 
Preparing for IEEEXtreme 12.0 & mora xtreme
Preparing for IEEEXtreme 12.0 & mora xtremePreparing for IEEEXtreme 12.0 & mora xtreme
Preparing for IEEEXtreme 12.0 & mora xtreme
 
Approaches to teaching primary computing
Approaches to teaching primary computingApproaches to teaching primary computing
Approaches to teaching primary computing
 
Road map to competitive programming
Road map to competitive programmingRoad map to competitive programming
Road map to competitive programming
 
midterm_fa08.pdf
midterm_fa08.pdfmidterm_fa08.pdf
midterm_fa08.pdf
 
Acm icpc-briefing-prof-nbv
Acm icpc-briefing-prof-nbvAcm icpc-briefing-prof-nbv
Acm icpc-briefing-prof-nbv
 
Types of errors 2019
Types of errors 2019Types of errors 2019
Types of errors 2019
 
Teaching of computer programming
Teaching of  computer programmingTeaching of  computer programming
Teaching of computer programming
 
What I wish colleges and bootcamps taught software developers
What I wish colleges and bootcamps taught software developersWhat I wish colleges and bootcamps taught software developers
What I wish colleges and bootcamps taught software developers
 
Programming of c++
Programming of c++Programming of c++
Programming of c++
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
 
01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx
 

Mehr von Fedor Tsarev

On NP-Hardness of the Paired de Bruijn Sound Cycle Problem
On NP-Hardness of the Paired de Bruijn Sound Cycle ProblemOn NP-Hardness of the Paired de Bruijn Sound Cycle Problem
On NP-Hardness of the Paired de Bruijn Sound Cycle Problem
Fedor Tsarev
 
Сборка генома de novo: мифы и реальность
Сборка генома de novo: мифы и реальностьСборка генома de novo: мифы и реальность
Сборка генома de novo: мифы и реальность
Fedor Tsarev
 
Talk at dnGASP workshop, April 5, 2011
Talk at dnGASP workshop, April 5, 2011Talk at dnGASP workshop, April 5, 2011
Talk at dnGASP workshop, April 5, 2011
Fedor Tsarev
 
04 динамическое программирование - основные концепции
04 динамическое программирование - основные концепции04 динамическое программирование - основные концепции
04 динамическое программирование - основные концепции
Fedor Tsarev
 

Mehr von Fedor Tsarev (10)

We are the champions: programming world champions from Russia. Why and what for?
We are the champions: programming world champions from Russia. Why and what for?We are the champions: programming world champions from Russia. Why and what for?
We are the champions: programming world champions from Russia. Why and what for?
 
Becoming a World Champion in Programming: Keep Calm and Compete
Becoming a World Champion in Programming: Keep Calm and CompeteBecoming a World Champion in Programming: Keep Calm and Compete
Becoming a World Champion in Programming: Keep Calm and Compete
 
On NP-Hardness of the Paired de Bruijn Sound Cycle Problem
On NP-Hardness of the Paired de Bruijn Sound Cycle ProblemOn NP-Hardness of the Paired de Bruijn Sound Cycle Problem
On NP-Hardness of the Paired de Bruijn Sound Cycle Problem
 
Сборка генома de novo: мифы и реальность
Сборка генома de novo: мифы и реальностьСборка генома de novo: мифы и реальность
Сборка генома de novo: мифы и реальность
 
Talk at dnGASP workshop, April 5, 2011
Talk at dnGASP workshop, April 5, 2011Talk at dnGASP workshop, April 5, 2011
Talk at dnGASP workshop, April 5, 2011
 
Доклад на семинаре в лаборатории алгоритмической биологии АУ
Доклад на семинаре в лаборатории алгоритмической биологии АУДоклад на семинаре в лаборатории алгоритмической биологии АУ
Доклад на семинаре в лаборатории алгоритмической биологии АУ
 
04 динамическое программирование - основные концепции
04 динамическое программирование - основные концепции04 динамическое программирование - основные концепции
04 динамическое программирование - основные концепции
 
01 линейные структуры данных
01 линейные структуры данных01 линейные структуры данных
01 линейные структуры данных
 
03 двоичные деревья поиска и очередь с приоритетами
03 двоичные деревья поиска и очередь с приоритетами03 двоичные деревья поиска и очередь с приоритетами
03 двоичные деревья поиска и очередь с приоритетами
 
02 сортировка и поиск
02 сортировка и поиск02 сортировка и поиск
02 сортировка и поиск
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 

Problem solving on acm international collegiate programming contest

  • 1. Problem Solving on ACM International Collegiate Programming Contest Fedor Tsarev, ACM ICPC World Champion 2008 St. Petersburg University of IT, Mechanics & Optics 18.10.2010 ETH Zurich
  • 2. 2 Epigraph The whole is more than the sum of its parts (Aristotle)
  • 3. 3 Perfect Team  Common code-style (indents, variable naming, …)  Common patterns of algorithm implementation  Everyone should know strong and weak points of other members of the team
  • 4. 4 Start of the Contest  Write a template  Read problem statements:  Starting with the first problem  Starting with the last problem  Do not try to solve the first problem you have read – find the simplest problem  Every member must know his role at the start of the contest
  • 5. 5 Problems Status № Member 1 Member 2 Member 3 Comments A + Graph theory B + C + D + …
  • 6. 6 One hour from the start of the contest… № Member 1 Member 2 Member 3 Comments A + Graph theory B + + + KMP C + + + DP over subsets D + + + Geometry … + + +
  • 7. 7 How to solve a problem 1. Read the statement carefully 2. Invent an algorithm 3. Discuss the algorithm with another member of your team 4. Discuss the implementation with another member of your team 5. Write a program 6. Test your solution
  • 8. 8 Submitting a Solution  Save the source file before submitting  Compile it  Always test the solution on example tests and on all tests you have:  Corner cases  Maximal tests (checking time limit and memory limit)  Print the source code after submitting (on the official contest)
  • 9. 9 If your solution is not accepted…  … then you have a bug in the program   To find it carefully read the printout  Never read the code from the screen  If you find a bug do not fix it right now on the computer – there are more bugs in the program  Fix the bug in the printout  Try to explain your code to another member of your team  Write a slower solution and stress-test with it  …
  • 10. 10 Debugging  Debugging is a very time-consuming process  You do not create code while debugging Avoid using debugger! Read the printout instead
  • 11. 11 Programming in Pairs  If the implementation is too difficult for you…  If you are tired…  If the code is large…  Try programming in pairs:  One of the team members writes the code  Another one is looking for mistakes  This idea is from eXtreme Programming
  • 12. 12 Last hour of the contest  Your goal is to get “Accepted” for all problems you have started  Do not start new problems if you have “old” ones  If you do not have enough time for all problems choose some of them
  • 13. 13 Log of the contest  Only for trainings  Helps you to analyze the results of the contest Time Member 1 Member 2 Member 3 30 Wrote a template Read A, B, C, D. Wrote solution for B Read F, G, H, I 60 … … … … … … … 300 … … …
  • 14. 14 Thank you! We wish you success in ACM ICPC!