6

Odd performance disparity between printf(C) and cout(C++)

 2 years ago
source link: http://codeforces.com/blog/entry/105687
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Odd performance disparity between printf(C) and cout(C++)

By oqfiqh, history, 8 hours ago,

I solved problem B (permutation chain) of the last contest, and the same exact program using printf and scanf (stdio.h) went over the time limit by a fair chunk (exceeded the time limit by 2s for a single test),instead when using cout and cin (iostream) it passed all tests in 100ms.

Does anyone have any idea why this is happening?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK