讨论 / OTL为何C++ iostream和cstdio差这么多。
lqybzx 2013-10-27 06:24:00
点我顶贴 收藏 删除
[NOIP2010]引水入城

iostream

测试结果1: 通过本测试点|有效耗时94ms

测试结果2: 通过本测试点|有效耗时109ms

测试结果3: 选手程序运行超过时限

测试结果4: 通过本测试点|有效耗时63ms

测试结果5: 通过本测试点|有效耗时62ms

测试结果6: 通过本测试点|有效耗时47ms

测试结果7: 通过本测试点|有效耗时63ms

测试结果8: 通过本测试点|有效耗时78ms

测试结果9: 通过本测试点|有效耗时297ms

测试结果10: 通过本测试点|有效耗时969ms

cstdio

测试结果1: 通过本测试点|有效耗时63ms

测试结果2: 通过本测试点|有效耗时62ms

测试结果3: 通过本测试点|有效耗时719ms

测试结果4: 通过本测试点|有效耗时47ms

测试结果5: 通过本测试点|有效耗时47ms

测试结果6: 通过本测试点|有效耗时62ms

测试结果7: 通过本测试点|有效耗时79ms

测试结果8: 通过本测试点|有效耗时109ms

测试结果9: 通过本测试点|有效耗时109ms

测试结果10: 通过本测试点|有效耗时469ms

而且iostream有时候还会编译超时OTL是测试机问题还是什么

#1 Lytning@2013-10-27 06:05:00
回复 删除
ios::sync_with_stdio(false);

#2 Lytning@2013-10-27 06:19:00
回复 删除
[quote][url=/Redirect.asp?Act=Reply&DID=12790&RID=31771]原帖[/url]由 [i]Lytning[/i] 于 2013-10-27 21:05:00 发表

ios::sync_with_stdio(false);

[/quote]

[color=red]关闭同步 貌似能加快cin cout的速度[/color]

#3 107229HR@2013-10-27 06:24:00
回复 删除
回复 板凳Lytning 的帖子

能大幅度加快

查看更多回复
提交回复