Example #1
0
File: run.php Project: Zhi2014/cogs
</td>
</tr>
<?php 
    }
    ?>
</table>
</div>
</div>
<div class='span6'>
<div class='alert'>
<p>运行时间 <?php 
    printf("%.3f", $Cp->gettotaltime() / 1000.0);
    ?>
 s</p>
<p>平均内存 <?php 
    printf("%.2f", $Cp->getmemory() / 1024);
    ?>
 MB</p>
<p>测试点通过状况 <a href="../submit/code.php?id=<?php 
    echo $info['sid'];
    ?>
"><?php 
    echo 评测结果($Cp->s_detail, 30);
    ?>
</a></p>
<p>得分:<b><?php 
    echo $Cp->getscore();
    ?>
</b></p>
<p><a href="../problem/problem.php?pid=<?php 
    echo $_POST['pid'];
Example #2
0
$info['pid'] = $d['pid'];
$info['uid'] = $d['uid'];
$info['language'] = $d['lang'];
$info['pname'] = $d['filename'];
$info['datacnt'] = $d['datacnt'];
$info['timelimit'] = $d['timelimit'];
$info['memorylimit'] = $d['memorylimit'];
$info['plugin'] = $d['plugin'];
$info['compiledir'] = $cdir;
$Cp = new Compiler($info);
$free = $Cp->getgds($_POST['judger']);
if (!$free) {
    echo "No Grader!Please Wait and Retry.";
    exit;
}
$Cp->lock();
$Cp->getdir();
$csucc = $Cp->compile();
if (!$csucc) {
    echo "0!C";
    $Cp->s_detail = "C";
} else {
    for ($P = 1; $P <= $d[datacnt]; $P++) {
        $Cp->run($P);
        $Cp->getresult();
    }
    $Cp->getscore();
    echo "{$Cp->s_score}!{$Cp->s_detail}!" . $Cp->gettotaltime() . "!" . $Cp->getmemory();
}
$Cp->writedb_comp($_POST['csid']);
$Cp->unlock();