Homework before week 8

This week we will have a closer look at the use of C++ and Python in programming contests.

Homework reading

If you have not yet used both C++ and Python in our course, first learn enough of the basics to write small programs in each language, similar to those we have seen so far in this course.

Please read at least the following parts of Competitive Programmer’s Handbook to prepare for week 8:

  • Section 1.1: Programming languages

  • Section 1.2: Input and output (note std::ios::sync_with_stdio)

  • Section 1.3: Working with numbers (note long long)

  • Section 1.4: Shortening code

  • Section 3.2: Sorting in C++

  • Section 4.5: Other structures: Bitset (note std::bitset)

  • Section 10.1: Bit representation

  • Section 10.2: Bit operations (note __builtin_popcount, etc.)

  • Section 10.3: Representing sets

  • Section 10.4: Bit optimizations

Then, please look at the following pages for further instructions:

Finally, please familiarize yourself with a contest library. One option is:

Homework problems

This time there will be two mini-contests, each containing one task:

  • a C++ contest

  • a Python contest

Use C++ to solve the task in the C++ contest and Python to solve the task in the Python contest. Please ask the course staff if you need help!

Use the same pre-created CSES homework account for both contests. Its name will look like aalto26hh_NNN. You will receive the account credentials at a course meeting; do not use a personal CSES account.

The homework contest details and point submission form will be added here soon.

Posting submission...