2016-10-25 15:53:43 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require('JudgeClient.php');
|
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
$token = 'YOUR_TOKEN_HERE';
|
|
|
|
|
|
|
|
$cSrc = <<<'CODE'
|
2016-10-25 15:53:43 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
int main(){
|
|
|
|
int a, b;
|
|
|
|
scanf("%d%d", &a, &b);
|
2017-12-11 13:51:44 +00:00
|
|
|
printf("%d\n", a+b);
|
2016-10-25 15:53:43 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2017-12-11 13:51:44 +00:00
|
|
|
CODE;
|
2016-10-25 15:53:43 +00:00
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
$cSpjSrc = <<<'CODE'
|
2016-10-25 15:53:43 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
int main(){
|
|
|
|
return 1;
|
|
|
|
}
|
2017-12-11 13:51:44 +00:00
|
|
|
CODE;
|
2016-10-25 15:53:43 +00:00
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
$cppSrc = <<<'CODE'
|
2016-10-25 15:53:43 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
int a,b;
|
|
|
|
cin >> a >> b;
|
|
|
|
cout << a+b << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
2017-12-11 13:51:44 +00:00
|
|
|
CODE;
|
2016-10-25 15:53:43 +00:00
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
$javaSrc = <<<'CODE'
|
2016-10-25 15:53:43 +00:00
|
|
|
import java.util.Scanner;
|
|
|
|
public class Main{
|
|
|
|
public static void main(String[] args){
|
|
|
|
Scanner in=new Scanner(System.in);
|
|
|
|
int a=in.nextInt();
|
|
|
|
int b=in.nextInt();
|
|
|
|
System.out.println(a + b);
|
|
|
|
}
|
|
|
|
}
|
2017-12-11 13:51:44 +00:00
|
|
|
CODE;
|
2016-10-25 15:53:43 +00:00
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
$py2src = <<<'CODE'
|
2016-10-25 15:53:43 +00:00
|
|
|
s = raw_input()
|
|
|
|
s1 = s.split(" ")
|
|
|
|
print int(s1[0]) + int(s1[1])
|
2017-12-11 13:51:44 +00:00
|
|
|
CODE;
|
|
|
|
|
|
|
|
$py3src = <<<'CODE'
|
|
|
|
s = input()
|
|
|
|
s1 = s.split(" ")
|
|
|
|
print(int(s1[0]) + int(s1[1]))
|
|
|
|
CODE;
|
2016-10-25 15:53:43 +00:00
|
|
|
|
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
$judgeClient = new JudgeClient($token, 'http://127.0.0.1:12358');
|
2016-10-25 15:53:43 +00:00
|
|
|
|
|
|
|
echo "ping:\n";
|
|
|
|
print_r($judgeClient->ping());
|
|
|
|
|
|
|
|
echo "\n\ncompile_spj:\n";
|
2017-12-11 13:51:44 +00:00
|
|
|
print_r($judgeClient->compileSpj($cSpjSrc, '2', JudgeClient::getLanguageConfigByKey('c_lang_spj_compile')));
|
|
|
|
|
|
|
|
echo "\n\nc_judge:\n";
|
|
|
|
print_r($judgeClient->judge($cSrc, 'c', 'normal', [
|
|
|
|
'output' => true
|
|
|
|
]));
|
|
|
|
|
|
|
|
echo "\n\nc_spj_judge:\n";
|
|
|
|
print_r($judgeClient->judge($cSrc, 'c', 'spj', [
|
|
|
|
'spj_version' => '3',
|
|
|
|
'spj_config' => JudgeClient::getLanguageConfigByKey('c_lang_spj_config'),
|
|
|
|
'spj_compile_config' => JudgeClient::getLanguageConfigByKey('c_lang_spj_compile'),
|
|
|
|
'spj_src' => $cSpjSrc,
|
|
|
|
]));
|
2016-10-25 15:53:43 +00:00
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
echo "\n\ncpp_judge:\n";
|
|
|
|
print_r($judgeClient->judge($cppSrc, 'cpp', 'normal'));
|
2016-10-25 15:53:43 +00:00
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
echo "\n\njava_judge:\n";
|
|
|
|
print_r($judgeClient->judge($javaSrc, 'java', 'normal'));
|
2016-10-25 15:53:43 +00:00
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
echo "\n\npy2_judge:\n";
|
|
|
|
print_r($judgeClient->judge($py2src, 'py2', 'normal'));
|
2016-10-25 15:53:43 +00:00
|
|
|
|
2017-12-11 13:51:44 +00:00
|
|
|
echo "\n\npy3_judge:\n";
|
|
|
|
print_r($judgeClient->judge($py3src, 'py3', 'normal'));
|