对拍程序总结
std
#include <bits/stdc++.h>
using namespace std;
int a,b;
int main()
{
freopen(".in","r",stdin);
freopen("std.out","w",stdout);
cin >> a >> b;
cout << a * b;
fclose(stdin);
fclose(stdout);
return 0;
}
暴力
#include <bits/stdc++.h>
using namespace std;
int a,b;
int main()
{
freopen(".in","r",stdin);
freopen("baoli.out","w",stdout);
cin >> a >> b;
int ans = 0;
for (int i = 1; i <= b; i++)
{
ans += a;
}
cout << ans;
fclose(stdin);
fclose(stdout);
return 0;
}
data
#include <bits/stdc++.h>
using namespace std;
int a,b;
int main()
{
freopen(".in","w",stdout);
srand(time(0));
cout << rand() % 1000000 << " " << rand() % 1000000;
fclose(stdout);
return 0;
}
check
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <bits/stdc++.h>
using namespace std;
int cnt,t1,t2;
int main()
{
while(cnt <= 10000)
{
cnt++;
system("data.exe");
t1 = clock();
system("std.exe");
t2 = clock();
system("baoli.exe");
if( system( "fc baoli.out std.out" ) )
{
cout << "NO";
break;
}
cout << "#" << cnt << " " << t2 - t1 << "ms" << " " << "YES" << endl;
}
}
include后可以只写万能头文件,其它可以不写