-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjudged.cpp
44 lines (44 loc) · 1.03 KB
/
judged.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<iostream>
#if defined(_WIN32)
#include<windows.h>
#endif
#include<cstdlib>
#include<fstream>
using namespace std;
void system(string x)
{
system(x.c_str());
}
int main()
{
while(1)
{
ifstream infile;
infile.open("task.txt");
string a,b,c,d;
bool have_task_flag=false;
while(infile>>a>>b>>c>>d)
{
have_task_flag=true;
#if defined(__linux__)
system("cp ./code/koishi/"+a+".exe ./runner/koishi.exe");
system("cp ./code/satori/"+b+".exe ./runner/satori.exe");
system("./runner/run.sh "+c+".txt "+a+" "+b+" "+d+".txt");
#elif defined(_WIN32)
system("copy .\\code\\koishi\\"+a+".exe .\\runner\\koishi.exe");
system("copy .\\code\\satori\\"+b+".exe .\\runner\\satori.exe");
system(".\\runner\\run.bat "+c+".txt "+a+" "+b+" "+d+".txt");
#endif
}
infile.close();
ofstream fileout("task.txt",ios::trunc);
fileout.close();
if(have_task_flag)
cout<<"DONE"<<endl;
#if defined(__linux__)
system("sleep 2s");
#elif defined(_WIN32)
Sleep(2000);
#endif
}
}