Skip to content

Article on common I/O optimizations #903

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy