自动AC机

今天$qbxt$的题有人$AK$,而且用时$0.00s$,后来发现是自动$AC$机,你会发现这个自动$AC$的写法是固定的,哪个题都可以直接交这份代码$AC$,所以发出来(看看就行了,比赛用你会被禁赛的) #仅供娱乐,请勿用于非法或违规用途 ``` #ifndef __linux__ #include #endif //#include //#include //#include #include #include #include #include #include using namespace std; string f=__FILE__; int n,l; typedef std::pair p; vector

v; char s[1000]; inline char*rread(int&r,char*s) { r=0; while(*s<'0'||*s>'9')s--; for(int b=1; *s>='0'&&*s<='9'; b*=10,s--) r+=b*(*s-'0'); return s; } #include int main() { f=f.substr(0,f.find_last_of('.',f.length())); #ifdef __linux__ DIR*dir=opendir(("../../data/"+f).c_str()); dirent*ptr; while((ptr=readdir(dir))!=NULL) if((l=strlen(ptr->d_name))>3&& (string(ptr->d_name).rfind(".out",l)==l-4|| string(ptr->d_name).rfind(".ans",l)==l-4)) { rread(n,ptr->d_name+strlen(ptr->d_name)); v.push_back(p(n,string(ptr->d_name))); } realpath(".",s); #else f=f.substr(f.find_last_of('\',f.length())+1,f.length()); WIN32_FIND_DATA d; HANDLE hFind=FindFirstFile(("..\..\data\"+f+"\*").c_str(), &d); do if((l=strlen(d.cFileName))>3&& (string(d.cFileName).rfind(".out",l)==l-4|| string(d.cFileName).rfind(".ans",l)==l-4)) { rread(n,d.cFileName+strlen(d.cFileName)); v.push_back(p(n,string(d.cFileName))); } while (FindNextFile(hFind, &d) != 0); FindClose(hFind); GetModuleFileName(NULL,s,1000); #endif rread(n,rread(l,s+strlen(s))); sort(v.begin(),v.end()); #ifdef __linux__ system(("cp -f ../../data/"+f+'/'+v[n].second+" "+f+".out").c_str()); #else system(("copy ..\..\data\"+f+'\'+v[n].second+" "+f+".out").c_str()); #endif return 0; } ```

原文地址:https://www.cnblogs.com/Liuz8848/p/11624779.html