SlideShare uma empresa Scribd logo
1 de 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!

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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 сортировка и поиск
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
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
 
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
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
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.
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
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
 
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.
 

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!