Introduction to Competitive Programming Instructor: William W.Y

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Competitive Programming Instructor: William W.Y Introduction to Competitive Programming Instructor: William W.Y. Hsu › Course Preliminaries › Introduction CONTENTS › A taste of Ad Hoc Problems 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 2 Course Preliminaries Why and what? Another programming course? 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 3 What you will learn › Reading comprehension. › Problem evaluation. › Parsing and formatting text. › Tricks to reduce code and bugs. › Generating test cases for your code. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 4 What you will learn › Algorithms that might be practiced – Dynamic Programming (DP) › State-space search, Games – Data structures › Binary indexed tree, Union-find › Computational geometry – Convex hull › Graph algorithms – Flow 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 5 Goal › Given a problem, we want to: – Solve it efficiently. – By using algorithms and data structures. – Convert our solution into a program. – Do it as quickly as possible (under pressure). – Do it correctly (without bugs)! › This course will exercise this process. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 6 Why compete › Makes you a better programmer and thinker in many situations › Intangible skill that will set you apart in the workforce › Be first of NTOU to attend NCPC, ACM-ICPC › It's fun :) 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 7 Ultimate goal › Please note that being well-versed in competitive programming is not the end goal, but only a means to an end. › The true end goal is to produce all-rounder computer scientists/ programmers who are much readier to produce better software and to face harder CS research problems in the future. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 8 Competitive Programming › Given well-known computer science problems, solve them as fast as possible. – Find a solution that reduces down to a well-known problems, not research problems. – Pass all the judge data correctly. – Solution should run fast enough. – Do not over-engineer the solution. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 9 How? › Study common types of problems. › Show common applications of algorithms and data structures you already know from: – Prof. Lin & Prof. Wu (the algorithms course). – Prof. Lin & Prof. Hsieh (the data structures course). › Introduce other common algorithms and data structures. › Go over some commonly used theory. › Practice problem solving. › Practice programming. › More practice. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 10 How? › More practice. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 11 How? › More practice. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 12 Possible topics › Introduction › Discrete structure › Mathematics › Divide and Conquer › Data Structures & Sorting › Dynamic Programming (DP) › Combinatorial Games › Greedy Algorithms › Binary Trees › Basic Graph Algorithms › Spanning Trees & Shortest Paths › Network Flow Problems › Computational Geometry › String Algorithms (Additional material: Suffix Arrays - A Programming Contest Approach) › Backtracking, Branch & Bound 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 13 Possible topics – decomposed › Arrays and iteration problems › backtracking problems › programming style / understanding › constructing subsets and permutations specifications › graph traversal problems › data structure problems › DFS/BFS › elementary data structures › graph algorithms problems › string problems › shortest paths and MST › strings and library functions › dynamic programming problems › sorting problems › edit distance and applications › sorting and library functions › grid problems › arithmetic problems › rectangular and hexagonal grids › arithmetic and algebra › geometry problems › combinatorics problems › geometric primitives and trigonometry › recurrence relations and counting › computational geometry › number theory problems › convex hulls and triangulation › divisibility and modular arithmetic 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 14 Forming Quiz Teams (uva10911) Abridged Problem Description: Let ( , ) be the coordinates of a student’s house on a 2D plane. There are students and we want to pair them into groups. Let be the distance between cost = the houses of 2 students in group . Form groups such that 2is minimized. =1 Output the minimum cost. Constraints: 1 8 and 0 , 1000∑ . ≤ ≤ ≤ ≤ Sample input: = 2; Coordinates of the = 4 houses are {1, 1}, {8, 6}, {6, 8}, and {1, 3}. Sample output: 2 cost = 4.83. Can you solve this problem? If so, how many minutes would you likely require to complete the working code 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 15 Where are you? › Uncompetitive programmer A (a.k.a. the blurry one): – Step 1: Reads the problem and becomes confused. (This problem is new for him). – Step 2: Tries to code something: Reading the non-trivial input and output. – Step 3: Realizes that all his attempts are not Accepted (AC): › Greedy: Repeatedly pairing the two remaining students with the shortest separating distances gives the Wrong Answer (WA). › Naive Complete Search: Using recursive backtracking and trying › all possible pairings yields Time Limit Exceeded (TLE). 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 16 Where are you? › Uncompetitive programmer B (Give up): – Step 1: Reads the problem and realizes that he has seen this problem before. › But also remembers that he has not learned how to solve this kind of problem... › He is not aware of the Dynamic Programming (DP) solution… – Step 2: Skips the problem and reads another problem in the problem set. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 17 Where are you? › (Still) Uncompetitive programmer C (Slow): – Step 1: Reads the problem and realizes that it is a hard problem: ‘minimum weight perfect matching on a small general weighted graph’. › However, since the input size is small, this problem is solvable using DP. › The DP state is a bitmask that describes a matching status, and matching unmatched students and will turn on two bits and in the bitmask. – Step 2: Codes I/O routine, writes recursive top-down DP, tests, debugs >.<... – Step 3: After 3 hours, his solution obtains AC (passed all the secret test data). 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 18 Where are you? › Competitive programmer D: – Completes all the steps taken by uncompetitive programmer C in ≤ 30 minutes. › Very competitive programmer E: – A very competitive programmer (e.g. the red ‘target’ coders in TopCoder [32]) would solve this ‘well known’ problem ≤ 15 minutes... 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 19 Course Administration › Course website – http://140.121.196.121/wwyhsu/?page_id=959 › Teaching staffs: – Lecturer: ME! › [email protected] › Ext: 6657 (preferably using emails) – TA1: 黃珮婷 [email protected] – TA2: 王浩勳 [email protected] – TA3: 游旻叡 [email protected] › Office hours: TBA 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 20 Grading › Tentative grading policy: – Homework and written quizzes (20%) – In class simulations (30%) – Midterm exam (25%) – Final exam (25%) – Extra credit policy for attending public contests: › CPE: 2% + 1% per solved problem › ITSA (月賽, 中文題為主): 1% +1% per solved problem. – ITSA 每年五月另舉辦桂冠挑戰大賽! 5% + 2% per solved problem. › PTC (月賽,以英文題為主): 2.5% + 1.5% per solved problem. › ACM-ICPC Regionals: 5% + 2% per solved problem. › ACM-ICPC World finals: 再說吧~ 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 21 Execution › Weekly courses. › Practice (simulation sessions) – Team based. – Vote: AT or RT! › Written exams and homework. – Single solo mode. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 22 Textbook › Steven Halim, Competitive Programming, 3rd Edition, ASIN: B00FG8MNN8. – http://www.amazon.com/Competitive-Programming-Edition- Steven-Halim/dp/B00FG8MNN8 – http://www.lulu.com/shop/http://www.lulu.com/shop/steven- halim/competitive-programming-3- hardcover/hardcover/product-21059922.html (Hardcover, $39.99) – http://www.lulu.com/shop/steven-halim/competitive- programming-3/ebook/product-21976335.html (E-book, $19.99) 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 23 References › S. S. Skiena, M. A. Revilla, Programming Challenges: The Programming Contest Training Manual, Springer, 2003 ed. (ISBN-10: 0387001638) › T. Cormen, C. Leiserson, R. Rivest, C. Stein, Introduction to Algorithms, 3rd ed., The MIT Press. (ISBN-10: 0262033844) › S. Skiena, The Algorithm Design Manual, 2nd ed., Springer. (ISBN-10: 1848000693) › R. Graham, D. Knuth, O. Patashnik, Concrete Mathematics: A Foundation for Computer Science. 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 24 This is an era of information explosion 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 25 References › ITSA: – http://algorithm.csie.ncku.edu.tw/ITSA_PTC/index_ITSA.php › PTC: – http://algorithm.csie.ncku.edu.tw/ITSA_PTC/index_PTC.php › CPE: – https://cpe.cse.nsysu.edu.tw/ › NCPC (程式設計組): – http://ncpc.ntnu.edu.tw/ncpc/showpage.php?id=3 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 26 Introduction Let’s get started! The problems › Typical programming contest problems usually consists of: – Problem description – Input description – Output description – Example input/output – A time limit in seconds – A memory limit in megabytes › You are asked to write a program that solves the problem for all valid inputs. – In IOI, partial solved problem receive partial score. › The program must not exceed time or memory limits! 9/11/2016 INTRODUCTION TO COMPETITIVE PROGRAMMING 28 Example problem Problem
Recommended publications
  • Lecture Notes, CSE 232, Fall 2014 Semester
    Lecture Notes, CSE 232, Fall 2014 Semester Dr. Brett Olsen Week 1 - Introduction to Competitive Programming Syllabus First, I've handed out along with the syllabus a short pre-questionnaire intended to give us some idea of where you're coming from and what you're hoping to get out of this class. Please fill it out and turn it in at the end of the class. Let me briefly cover the material in the syllabus. This class is CSE 232, Programming Skills Workshop, and we're going to focus on practical programming skills and preparation for programming competitions and similar events. We'll particularly be paying attention to the 2014 Midwest Regional ICPC, which will be November 1st, and I encourage anyone interested to participate. I've been working closely with the local chapter of the ACM, and you should talk to them if you're interesting in joining an ICPC team. My name is Dr. Brett Olsen, and I'm a computational biologist on the Medical School campus. I was invited to teach this course after being contacted by the ACM due to my performance in the Google Code Jam, where I've been consistently performing in the top 5-10%, so I do have some practical experience in these types of contests that I hope can help you improve your performance as well. Assisting me will be TA Joey Woodson, who is also affiliated with the ACM, and would be a good person to contact about the ICPC this fall. Our weekly hour and a half meetings will be split into roughly half lecture and half practical lab work, where I'll provide some sample problems to work on under our guidance.
    [Show full text]
  • Declaratively Solving Tricky Google Code Jam Problems with Prolog-Based Eclipse CLP System
    Declaratively solving tricky Google Code Jam problems with Prolog-based ECLiPSe CLP system Sergii Dymchenko Mariia Mykhailova Independent Researcher Independent Researcher [email protected] [email protected] ABSTRACT produces correct answers for all given test cases within a In this paper we demonstrate several examples of solving certain time limit (4 minutes for the \small" input and 8 challenging algorithmic problems from the Google Code Jam minutes for the \large" one). programming contest with the Prolog-based ECLiPSe sys- tem using declarative techniques: constraint logic program- GCJ competitors can use any freely available programming ming and linear (integer) programming. These problems language or system (including the ECLiPSe2 system de- were designed to be solved by inventing clever algorithms scribed in this paper). Most other competitions restrict par- and efficiently implementing them in a conventional imper- ticipants to a limited set of popular programming languages ative programming language, but we present relatively sim- (typically C++, Java, C#, Python). Many contestants par- ple declarative programs in ECLiPSe that are fast enough ticipate not only in GCJ, but also in other contests, and to find answers within the time limit imposed by the con- use the same language across all competitions. When the test rules. We claim that declarative programming with GCJ problem setters design the problems and evaluate their ECLiPSe is better suited for solving certain common kinds complexity, they keep in mind mostly this crowd of seasoned of programming problems offered in Google Code Jam than algorithmists. imperative programming. We show this by comparing the mental steps required to come up with both kinds of solu- We show that some GCJ problems that should be challeng- tions.
    [Show full text]
  • Competitive Programming
    Competitive Programming Frank Takes LIACS, Leiden University https://liacs.leidenuniv.nl/~takesfw/CP Lecture 1 | Introduction to Competitive Programming Frank Takes | CP | Lecture 1 | Introduction to Competitive Programming 1 / 30 : problem solving, algorithm selection, algorithm design, data structure optimization, complexity analysis, . in a competitive context, i.e., with limited CPU time limited memory consumption a fixed amount of problem solving time (optional) others competing with you (more optional) This is not software engineering, but algorithmic problem solving. About this course Competitive Programming Frank Takes | CP | Lecture 1 | Introduction to Competitive Programming 2 / 30 . in a competitive context, i.e., with limited CPU time limited memory consumption a fixed amount of problem solving time (optional) others competing with you (more optional) This is not software engineering, but algorithmic problem solving. About this course Competitive Programming: problem solving, algorithm selection, algorithm design, data structure optimization, complexity analysis, . Frank Takes | CP | Lecture 1 | Introduction to Competitive Programming 2 / 30 , i.e., with limited CPU time limited memory consumption a fixed amount of problem solving time (optional) others competing with you (more optional) This is not software engineering, but algorithmic problem solving. About this course Competitive Programming: problem solving, algorithm selection, algorithm design, data structure optimization, complexity analysis, . in a competitive context
    [Show full text]
  • Model Answer
    Competitive Programming and Big-O Notation Anson Ho Flow 1. Introduction to competitive programming 2. Skills and advices for competitive programming 3. Big-O Notation Programming • Algorithm – idea, outline – flowchart • Program – codes in specific programming languages • Target – problem solving Competitive Programming • Usually for competitions • More limits on – runtime – memory – resources • time • software • hardware – available programming languages Online judge • HKOI online judge • Codeforces • Codechef • TopCoder • POJ • HDU online judge • AtCoder • May have contests regularly Contest • Annual contest – IOI – NOI – APIO – ACM ICPC – CCC • Open contest – Facebook Hacker Cup – Google Code Jam Contest structure • Individual/ team • Length • Full feedback? • Pretest? • Partial score (subtask)? • Batch score/ score per test • Time penalty? • Hack? Programming languages • Common – C, C++, Java, Pascal, Python, … • HKOI (16/17) – C, C++, Pascal Programming languages • IOI 16 – C++, Pascal, Java – C and Pascal will be removed – Python will be added • NOI 16 – C, C++, Pascal – C and Pascal will be removed in 2020 Environment • Onsite/ online • Operating system • Compiler • IDE/ text editor • Beware of the differences between the computer for coding and the computer for judging Topics • Basic Problem type • Input and output • Interactive • Output only • (Other) Common verdict (HKOI) Verdict (HKOI) • Accepted • Compilation Error • Wrong Answer • Time Limit Exceeded • Runtime Error • Partial Score Verdict (other) • Wrong Output Format •
    [Show full text]
  • Early Introduction of Competitive Programming
    Olympiads in Informatics, 2008, Vol. 2, 149–162 149 © 2008 Institute of Mathematics and Informatics, Vilnius Early Introduction of Competitive Programming Pedro RIBEIRO Departamento de Ciência de Computadores, Faculdade de Ciências, Universidade do Porto Rua do Campo Alegre, 1021/1055, 4169-007 PORTO, Portugal e-mail: [email protected] Pedro GUERREIRO Universidade do Algarve Gambelas, 8005-139 FARO, Portugal e-mail: [email protected] Abstract. Those who enjoy programming enjoy programming competitions, either as contestants or as coaches. Often coaches are teachers, who, aiming at better results in the future, would like to have more and more students participating, from earlier stages. Learning all the basic algorithms takes some time, of course; on the other hand, competition environments can be introduced right from the beginning as a pedagogical tool. If handled correctly, this can be very effective in helping to reach the goals of the course and, as a side-effect, in bringing larger crowds of students into the programming competition arena. Key words: programming contests, computer science education, automatic evaluation systems, competitive programming, introductory programming, IOI, International Olympiads in Informatics. 1. Introduction The most popular programming competitions are geared to imperative languages and to input-output problems. The automatics judges that handle submissions have been custom- arily designed for that environment. In our own programming courses, at our universities, we are using one such judge as a learning tool. Students submit their programming as- signments to the judge, with the benefit of immediate feedback, more reliable than what could be provided by a teaching assistant. Moreover, the automatic judge publishes a ranking of the students by number of accepted submissions, and this induces a healthy competitive attitude that many students enjoy and that makes them work harder and in a more disciplined way than they would otherwise.
    [Show full text]
  • If I Am Not Good at Solving the Problems on the Competitive Programming Sites Like Codechef Or Hackerrank, Where Am I Lagging? - Quora
    9/28/2014 If I am not good at solving the problems on the competitive programming sites like CodeChef or Hackerrank, where am I lagging? - Quora QUESTION TOPICS If I am not good at solving the problems on the RELATED QUESTIONS competitive programming sites like CodeChef or HackerRank CodeChef: I am in my third year of Hackerrank, where am I lagging? university now. What should be my Codeforces strategy so that I am comfortable with I am a second year undergrad at one of the IITs and very decent with my CPI Sphere Online Judge solving problems of gene... (continue) (SPOJ) as of now. I have tried quite a few times to start with the likes of above mentioned sites but even the basic level questions take a long time for me to Computer Programming: Why am I CodeChef unable to concentrate in problem solving, get completed? If I know the programming language, if I understand the coding, reading, poor at math? TopCoder questions, where is the fallacy on my part that is preventing me from getting Competitive over them(solving questions) quickly and efficiently? I am quite motivated towards Programming programming, but there is a phase when I am unable to solve most of the problems. Software Follow Question 190 Comment Share 2 Downvote How do I ge... (continue) Programming Languages I am new to competitive programming, just joined CodeChef 10 days back. I am Indian Institutes of Sumit Saurabh finding the easy level questions very Technology (IITs) Edit Bio • Make Anonymous difficu... (continue) Computer Science Write your answer, or answer later.
    [Show full text]
  • Understanding Unsolvable Problem
    Olympiads in Informatics, 2016, Vol. 10, 87–98 87 © 2016 IOI, Vilnius University DOI: 10.15388/ioi.2016.06 Understanding Unsolvable Problem Jonathan Irvin GUNAWAN Undergraduate Student School of Computing, National University of Singapore Computing 1, 13 Computing Drive, Singapore 117417 e-mail: [email protected] Abstract. In recent IOIs, there are several problems that seem unsolvable, until we realise that there is a special case to the problem that makes it tractable. In IOI 2014, the problem ‘Friend’ appears to be a standard NP-hard Maximum Independent Set problem. However, the graph is gen- erated in a very special way, hence there is a way to solve the problem in polynomial time. There were several contestants who didn’t identify the special case in this problem, and hence were stuck at the problem. In this paper, we will study a well-known technique called reduction to show that a problem we are currently tackling is intractable. In addition, we introduce techniques to identify special cases such that contestants will be prepared to tackle these problems. Keywords: special case, unsolvable, NP-hard. 1. Introduction The problem ‘Friend’ in IOI 2014 required contestants to find a set of vertices with maxi- mum total weight, such that no two vertices in the set are sharing a common edge. This is a classical Weighted Maximum Independent Set problem. We can show that Weight- ed Maximum Independent Set problem is NP-hard by reduction from 3-SAT (Cormen et al., 2009). Since the formulation of NP-completeness 4 decades ago, no one has been able to propose a solution to any NP-hard problem in polynomial time.
    [Show full text]
  • A Competitive Programming Approach to a University Introductory Algorithms Course
    Olympiads in Informatics, 2017, Vol. 11, 87–92 87 © 2017 IOI, Vilnius University DOI: 10.15388/ioi.2017.07 A Competitive Programming Approach to a University Introductory Algorithms Course Antti LAAKSONEN Department of Computer Science University of Helsinki e-mail: [email protected] Abstract. This paper is based on our experiences on teaching a university introductory algorithms course using ideas from competitive programming. The problems are solved using a real program- ming language and automatically tested using a set of test cases. Like in programming contests, there are no hints and well-known problems are not used. The purpose of such problems, com- pared to traditional problems, is to better improve the problem solving skills of the students. Keywords: algorithms course, competitive programming. 1. Introduction This paper summarizes our experiences on teaching the Data Structures and Algorithms course at the University of Helsinki using ideas from competitive programming. The course deals with basic data structures and algorithms, such as trees, graphs and sorting. The course is a compulsory course for computer science students, and it is usually taken during the first year of studies. The course book is Introduction to Algorithms (Cormen et al., 2009), though the course covers only a part of the book. For some years ago, the course was purely theoretic and algorithm design problems were solved using pen and paper and discussed in exercise sessions. However, it was observed that the learning results were not good and many students had difficulties in de- signing even very simple algorithms. After this, some ideas from competitive program- ming have been used on the course to improve the student’s problem solving skills.
    [Show full text]
  • A Survey on Online Judge Systems and Their Applications
    1 A Survey on Online Judge Systems and Their Applications SZYMON WASIK∗†, Poznan University of Technology and Polish Academy of Sciences MACIEJ ANTCZAK, Poznan University of Technology JAN BADURA, Poznan University of Technology ARTUR LASKOWSKI, Poznan University of Technology TOMASZ STERNAL, Poznan University of Technology Online judges are systems designed for the reliable evaluation of algorithm source code submitted by users, which is next compiled and tested in a homogeneous environment. Online judges are becoming popular in various applications. Thus, we would like to review the state of the art for these systems. We classify them according to their principal objectives into systems supporting organization of competitive programming contests, enhancing education and recruitment processes, facilitating the solving of data mining challenges, online compilers and development platforms integrated as components of other custom systems. Moreover, we introduce a formal definition of an online judge system and summarize the common evaluation methodology supported by such systems. Finally, we briefly discuss an Optil.io platform as an example of an online judge system, which has been proposed for the solving of complex optimization problems. We also analyze the competition results conducted using this platform. The competition proved that online judge systems, strengthened by crowdsourcing concepts, can be successfully applied to accurately and efficiently solve complex industrial- and science-driven challenges. CCS Concepts: •General and reference ! Evaluation; •Mathematics of computing ! Combinatorics; Discrete optimization; •Theory of computation ! Design and analysis of algorithms; •Networks ! Cloud computing; Additional Key Words and Phrases: online judge, crowdsourcing, evaluation as a service, challenge, contest ACM Reference format: Szymon Wasik, Maciej Antczak, Jan Badura, Artur Laskowski, and Tomasz Sternal.
    [Show full text]
  • Competitive Programmer's Handbook
    Competitive Programmer’s Handbook Antti Laaksonen Draft August 19, 2019 ii Contents Preface ix I Basic techniques 1 1 Introduction 3 1.1 Programming languages . .3 1.2 Input and output . .4 1.3 Working with numbers . .6 1.4 Shortening code . .8 1.5 Mathematics . 10 1.6 Contests and resources . 15 2 Time complexity 17 2.1 Calculation rules . 17 2.2 Complexity classes . 20 2.3 Estimating efficiency . 21 2.4 Maximum subarray sum . 21 3 Sorting 25 3.1 Sorting theory . 25 3.2 Sorting in C++ . 29 3.3 Binary search . 31 4 Data structures 35 4.1 Dynamic arrays . 35 4.2 Set structures . 37 4.3 Map structures . 38 4.4 Iterators and ranges . 39 4.5 Other structures . 41 4.6 Comparison to sorting . 44 5 Complete search 47 5.1 Generating subsets . 47 5.2 Generating permutations . 49 5.3 Backtracking . 50 5.4 Pruning the search . 51 5.5 Meet in the middle . 54 iii 6 Greedy algorithms 57 6.1 Coin problem . 57 6.2 Scheduling . 58 6.3 Tasks and deadlines . 60 6.4 Minimizing sums . 61 6.5 Data compression . 62 7 Dynamic programming 65 7.1 Coin problem . 65 7.2 Longest increasing subsequence . 70 7.3 Paths in a grid . 71 7.4 Knapsack problems . 72 7.5 Edit distance . 74 7.6 Counting tilings . 75 8 Amortized analysis 77 8.1 Two pointers method . 77 8.2 Nearest smaller elements . 79 8.3 Sliding window minimum . 81 9 Range queries 83 9.1 Static array queries .
    [Show full text]
  • Interactive Coding Platform for Students
    International Journal of Recent Technology and Engineering (IJRTE) ISSN: 2277-3878, Volume-7 Issue-4S, November 2018 Interactive Coding Platform for Students T.K. Chandru, M. Dinesh Kumar, S. Karthikeyan, K. Saranya Abstract: Programming has become one of the most demanded There will always be a need for developers, because our skill of a working professional in almost every industry. Even need for apps and software is steadily growing. Regardless though we have a lot of platform to work on and learn from, we of what background you have, the ability to contribute to are not properly trained in this domain . This has increased the need for a platform that is targeted only for the colleges students software means that you are always employable, always able to develop a coding culture among them , right from the start. to create and advance technology and always able to be on The project that we aim to develop solves this particular issue and the cutting edge of innovation. The pace to solve and code a will also enhance the skills of the students by continuous program will considerably increase only upon continuous feedback learning. The end-product will be a web application practice and here is a platform for it. Whether it is for which the teachers can use to set problems and give assignments personal growth and development, career advancement, while the students will use the application to solve the assignments. The application will be developed using: VueJS in career change, or just a desire to improve digital literacy, the front-end, the database will be MongoDB and the back-end knowledge of how software works and the ability to will be composed of ExpressJS and NodeJS entities.
    [Show full text]
  • A New Book on Competitive Programming (167-170)
    Olympiads in Informatics, 2017, Vol. 11, 167–170 167 © 2017 IOI, Vilnius University DOI: 10.15388/ioi.2017.14 REVIEWS, COMMENTS A New Book on Competitive Programming Antti LAAKSONEN Department of Computer Science University of Helsinki e-mail: [email protected] Abstract: This paper presents a new book on competitive programming: Competitive Program- mer’s Handbook. The purpose of the book is to provide a modern introduction to competitive programming, and the book is especially intended for future IOI and ICPC participants. Keywords: competitive programming, book 1 Introduction While the popularity of competitive programming is growing every year, there are not many books devoted to the topic. Thus, in 2013, I started the project of writing a new book on competitive programming. The purpose of the book is to give a thorough in- troduction to modern competitive programming and to be accessible to readers without background in programming contests. Initially I wrote the book in Finnish, and I had to rewrote the entire book several times before the result was satisfactory. Then, in 2016, I decided to translate the book into English, because most people in the competitive programming community can’t read Finnish. The title of the book became Competitive Programmer’s Handbook (in Finnish: Kisakoodarin käsikirja). Of course, before writing the book, I carefully studied the existing books on competi- tive programming. In 2003, Skiena and Revilla wrote the pioneering book in the field, Programming Challenges. Then, between 2010 and 2013, the Halim brothers published three books called Competitive Programming 1–3. My book would resemble those 168 A.
    [Show full text]