SlideShare une entreprise Scribd logo
1  sur  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!

Contenu connexe

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Plus 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
 

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

Dernier

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Dernier (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
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
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

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!