I've been using iostream for c++14 for a long time. Would it be more simple if I switched to stdio.h?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
I've been using iostream for c++14 for a long time. Would it be more simple if I switched to stdio.h?
Название |
---|
I first learned iostream, but I'm pretty sure stdio.h would be more simple
umm....
Why would stdio be simpler?
iostream is very easy to use, and it's easy to make it faster by removing synchronization with the stdio library and untying std::cin and std::cout. In almost all cases, using iostream with these 2 optimizations will let your code pass the TL.
There are maybe 4 or 5 problems that I've solved that actually didn't pass with iostream. One of them is Problem J of the Arab Collegiate Programming Contest from 2010. That problem has almost 80MB of input files. I think even stdio didn't stand a chance there. I recall writing my own thing to read the input in 1KB blocks or something.
I also recall this problem: http://codeforces.net/gym/101102/problem/J I couldn't get it to pass with iostream, but stdio passed just fine.
This is pretty rare in my opinion though. Don't take it too seriously, it's one data point.
iostream is more extensible ... If the data type is something different like pid_t ... You don't need to find the exact formate specifier for it. The disadvantage is that it is a little slower ... However there are ways to get around it.
P.S. — You can use cstdio ... It has all of the functions in stdio.h. I use cstdio when I use printf and scanf is C++ programs.