Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 796 Bytes

README.md

File metadata and controls

21 lines (17 loc) · 796 Bytes

A collection of algorithms

Competition Notes

  • Runtime Error: Check memory limits, are there implicit conditions?
  • Runtime Error: Do all declared functions return? If a function is int, make sure it returns something!
  • Be generous with data type limits: 2,147,483,647 (int), 9,223,372,036,854,775,807 (ll)
  • Usually, just set to ll.
  • Offline query
  • Probabilistic method (anything to do with 1/2)
  • Mod can be negative! Do NOT use if (x%2 == 1). Rather, use if (x%2 != 0)

Debugging

  • Index array last (caches)
  • long long instead of int
  • Array size, ordering, increments
  • TLE: use '\n' instead of endl (no intermediate flush)

Resources