Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

You can use several words in query to find by all of them at the same time. In addition, if you are lucky search understands word forms and some synonyms. It supports search by title and author. Examples:

  • 305 — search for 305, most probably it will find blogs about the Round 305
  • andrew stankevich contests — search for words "andrew", "stankevich" and "contests" at the same time
  • user:mikemirzayanov title:testlib — search containing "testlib" in title by MikeMirzayanov
  • "vk cup" — use quotes to find phrase as is
  • title:educational — search in title

Results

1.
By andreyv, 14 years ago, translation, In English
Yet again on C++ input/output Hello! I wish to continue the discussion on C++ input/output performance, which was [started](http://codeforces.me/blog/entry/562) by [user:freopen,2012-09-05] long ago. [user:freopen,2012-09-05] compared the speed of the two common input/output methods in C++: the stdio library, inherited from C (`<stdio>`), and the newer iostreams library (`<iostream>`/…). However, these tests did not account for the fact that there are several important iostreams optimizations which can be used. They have been mentioned more than once on Codeforces ([first](http://codeforces.me/blog/entry/10), [second](http://codeforces.me/blog/entry/4006), [third](http://codeforces.me/blog/entry/4669)). I have written [a program](https://bitbucket.org/andreyv/cppiotest/src/tip/iotest.cpp) that compares performance of the stdio and iostreams libraries with these optimizations turned on. [cut]   **UPD1**: Added information on `_CRT_DISABLE_PERFCRIT_LOCKS`.<br/> **UPD2**: Added `printf()`/`scanf()` ca...
Yet again on C++ input/output, Hello! I wish to continue the discussion on C++ input/output performance, which was [started

Full text and comments »

  • Vote: I like it
  • +63
  • Vote: I do not like it

2.
By CodingKnight, 6 years ago, In English
A simple C++ input-stream manipulator to discard all characters until and including the new-line character Hello Codeforces, It is well-known that [C++ Input/output manipulators](https://en.cppreference.com/w/cpp/io/manip) such as `fixed`, `setprecision`, `endl`, etc. are helper functions that serve as user-friendly control commands to input/output streams. An input-stream command that is necessary but not common in competitive programming is _to discard all characters until and including the new-line character_. An example for this issue is the following [HackerEarth problem](https://www.hackerearth.com/practice/algorithms/string-algorithm/basics-of-string-manipulation/practice-problems/algorithm/conversion-11/). Although the problem is very easy, its data-input invovles a trick that the input string in each line can include a space character as a part of the string. Using the function call [std::getline(cin,s)](https://en.cppreference.com/w/cpp/string/basic_string/getline) to read the line which includes space characters right after reading the number of test cases using the in...
A simple C++ input-stream manipulator to discard all characters until and including the new-line, cases using the input command `cin >> t` causes the first call of `std::getline(cin,s)` to read an, elegant solution is to declare and use a simple C++ input-stream manipulator whose purpose is to disard, issue, but a more elegant solution is to declare and use a simple C++ input -streammanipulator, An input-stream command that is necessary but not common in competitive programming is _to discard, It is well-known that [C++ Input/output manipulators](https://en.cppreference.com/w/cpp/io/manip, The followng is the one-line code of the `skip_endl` input-stream manipulator.

Full text and comments »

  • Vote: I like it
  • +26
  • Vote: I do not like it

3.
By Bishoy_Sedra, history, 3 years ago, In English
"VS Code doesn't support bits/stdc++.h" Solution If you are using Visual Studio Code (VS Code) for solving C++ problems on platforms like Codeforces and you encounter issues with `#include <bits/stdc++.h>` not being supported, here's a simple solution to get it working. - **Create a `bits` folder**: Start by creating a new folder named 'bits' in the same directory where your main C++ files for problem-solving are located. - **Create a header file**: Inside the `bits` folder, create a new header file named `stdc++.h`. Make sure the extension of the file is `.h` to create a valid header file. - **Add necessary headers**: Open the `stdc++.h` file and copy-paste the following commonly used C++ standard library headers into it: ~~~~~ #include <iostream> // Input/output stream objects #include <fstream> // File stream objects #include <sstream> // String stream objects #include <iomanip> // Input/output manipulators #include <string> // String class and functions #include <vector> // Dyn...
~~~~~ #include // Input/output stream objects #include // File

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it

4.
By imaking, 6 years ago, In English
Hackerrank C++ Challenge — Notes 1. String Stream ------------------ Header file : sstream stringstream is a stream class to operate on strings. It implements input/output operations on memory (string) based streams. stringstream can be helpful in different type of parsing. The following operators/functions are commonly used here Operator >> Extracts formatted data. Operator << Inserts formatted data. **Method str()** : returns a string object with a copy of the current contents of the stream. **Method str(string)** : sets s as the contents of the stream, discarding any previous contents. ~~~~~ std::stringstream ss; ss.str ("Example string"); std::string s = ss.str(); std::cout << s << '\n'; ~~~~~ **Common use :** One common use of this class is to **parse comma-separated integers from a string** (e.g., "23,4,56"). ~~~~~ stringstream ss("23,4,56"); char ch; int a, b, c; ss >> a >> ch >> b >> ch >> c; // a = 23, b = 4, c = 56 ~~~~~ If the >> operator returns a value, that i...
operate on strings. It implements input/output operations on memory (string) based streams

Full text and comments »

  • Vote: I like it
  • +11
  • Vote: I do not like it