Skip to content

Article on common I/O optimizations #903

Open
@jxu

Description

@jxu

It's well-known for competition programming in C++ to use the following simple I/O optimizations:

  • ios_base::sync_with_stdio(false) which shouldn't ever be a problem as you shouldn't use C I/O in c++ ever
  • cin.tie(0) (except for maybe interactive problems)

(they should be prefixed with std:: but competition programmers use namespace std which is bad style but probably ok for cp)

Here's an ancient Dr Dobbs article on it https://www.drdobbs.com/the-standard-librarian-iostreams-and-std/184401305
also https://codeforces.com/blog/entry/6251

Should this be its own article? So we have a convenient reference instead of tracking down CF blogs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions