Checker
//chk.cpp
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
typedef long long ll;
void SetColorAndBackground(int ForgC, int BackC) {
WORD wColor = ((BackC & 0x0F) << 4) + (ForgC & 0x0F);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), wColor);
}
int main() {
system("@echo off");
system("cd D:\\OI");
system("cd ..//..//..//..//..//..//..//..//..//");
system("D:");
// if (!system("fc>nul 2>nul test.out true.out"))
// cout << "Yes!";
// else cout << "No!";
int cnt = 0;
int flg = 0;
string True;
cout << "True Program Name:";
cin >> True;
string __STD;
cout << "Need Check Program Name:";
cin >> __STD;
True += ".exe < .in > true.out";
__STD += ".exe < .in > std.out";
while (cnt < 100) {
system("gen > .in");
system(True.c_str());
system(__STD.c_str());
if (!system("fc>nul 2>nul /w true.out std.out")) {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
cout << "Accepted!\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
}else {
flg = 1;
string tmp = "";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
cout << "WA on #" << cnt + 1 << '\n' << "***** .IN\n";
system("type .in");
cout << '\n';
system("fc /w true.out std.out");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
return 0;
}
cnt ++;
}
if (!flg) {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
cout << "Conguatulations! 100pts!!!";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
}
}
Genarator
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 70;
mt19937 rd(chrono::system_clock::now().time_since_epoch().count());
int main() {
//rd() % N來生成一個隨機數
return 0;
}
True.cpp 存放暴力或題解
std.cpp 自己的程式