标签:测试 har 时间 总结 ace 代码 gets its get
#include<bits/stdc++.h>
using namespace std;
const int N=1e8+50;
char a[N];
inline void solve1()
{
gets(a);
}
inline void solve2()
{
scanf("%s",&a);
}
inline void solve3()
{
char ch;
while(ch!='\n')
ch=getchar();
}
inline void solve4()
{
int i=0;
while(~scanf(" %c",&a[i]))
i++;
}
int main()
{
freopen("judge.txt","r",stdin);
clock_t s,t;
s=clock();
//solve1();
//solve2();
//solve3();
solve4();
t=clock();
cout<<t-s<<endl;
return 0;
}
(大部分测试内容于评测鸭上进行)
以下为测试内容:(单位:ms)
数据大小:10000
(gets字符串):0.040394
(scanf字符串):0.051836
(getchar单字符):0.057788
(scanf单字符):0.533744
数据大小:100000
(gets字符串):0.149481
(scanf字符串):0.229154
(getchar单字符):0.315258
(scanf单字符):5.139085
数据大小:1000000
(gets字符串):5
(scanf字符串):56
(getchar单字符):48
(scanf单字符):324数据大小:100000000
(gets字符串):661
(scanf字符串):5215
(getchar单字符):4426
(scanf单字符):31578
(本测试仅供参考)
标签:测试 har 时间 总结 ace 代码 gets its get
原文地址:https://www.cnblogs.com/loafer-924/p/11888283.html