std:ios:sync_with_stdio (false)以及局限性

时间:2020-07-12 12:12:53   收藏:0   阅读:67

如何在输入输出上提高一下效率emmmm

 1 #include<iostream>
 2 #include<stdio.h>
 3 #include<stdlib.h> 
 4 #include<time.h>
 5 using namespace std;
 6 
 7 int main(){
 8     int start=clock();
 9 
10     std::ios::sync_with_stdio(false);
11     for (int i=0;i<10000000;i++){
12         int t;
13        cin>>t;
14     }
15     printf("%.3lf\n",double(clock()-start)/CLOCKS_PER_SEC);
16     return 0;
17 }

 

技术图片

 

置无关.

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!