自用模版
#include <bits/stdc++.h>
namespace xuan_never {
using namespace std;
typedef long long ll;
#define fi first
#define se second
void mian() {
}
} using namespace xuan_never;
int main() {
#ifdef LOCAL
freopen("my.in", "r", stdin);
#endif
cin.tie(nullptr)->sync_with_stdio(false), cout.tie(nullptr);
int T = 1;
// cin >> T;
while (T--) mian();
return 0;
}编译选项
g++ -static -Wl,--stack=66000000 -std=c++14 -O2 -DLOCAL -Werror对拍程序
#include <iostream>
#include <windows.h>
#include <ctime>
using namespace std;
int n = 5000;
long long st, ti, TMax = 4000;
int main() {
for (int i = 1; i <= n; ++i, printf("\n")) {
system("data.exe > data.in");
system("std.exe < data.in > std.out");
st = clock();
system("My.exe < data.in > My.out");
ti = (clock() - st) * 1000.0 / CLOCKS_PER_SEC;
if (ti > TMax) {
printf("#%d TLE %dms", i, ti);
break;
} else if (system("fc /a /w std.out My.out > temp.txt")) {
printf("#%d WA %dms", i, ti);
break;
} else
printf("#%d AC %dms", i, ti);
}
return 0;
}fastio
namespace io{const int SIZE=(1<<21)+1;char ib[SIZE],*iS,*iT;
char ob[SIZE],*oS=ob,*oT=oS+SIZE-1,c,qu[55];bool f;int qr;
#define gc()(iS==iT?(iT=(iS=ib)+fread(ib,1,SIZE,stdin),(iS==iT?EOF:*iS++)):*iS++)
inline void flush(){fwrite(ob,1,oS-ob,stdout),oS=ob;}inline void pc(char x){*oS++
=x;if(oS==oT)flush();}template<class I>inline void read(I&x){for(f=1,c=gc();!
isdigit(c);c=gc())if(c=='-')f=0;for(x=0;isdigit(c);c=gc())x=(x<<3)+(x<<1)+(c&15);
x=f?x:-x;}inline void read(string&x){for(c=gc();!isgraph(c);c=gc());for(x="";
isgraph(c);c=gc())x+=c;}inline void print(string x){for(char c:x)pc(c);}
template<class I>inline void write(I x){if (!x)pc('0');if(x<0)pc('-'),x=-x;
while(x)qu[++qr]=x%10+48,x/=10;while(qr)pc(qu[qr--]);}struct Flusher_{~Flusher_()
{flush();}}io_flusher_;}using namespace io;Time
chrono::system_clock::now().time_since_epoch().count()