line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OnlineJudge::Progra::Test; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2408
|
use Cwd; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
155
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
5
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
703
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.023'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Simple get subroutine |
10
|
|
|
|
|
|
|
sub get { |
11
|
1
|
|
|
1
|
0
|
6
|
my @foo; |
12
|
1
|
|
|
|
|
8
|
my $path = getcwd; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# We create some dummy requests |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# accepted |
17
|
1
|
|
|
|
|
13
|
my $r1 = { |
18
|
|
|
|
|
|
|
'rid' => 1, |
19
|
|
|
|
|
|
|
'timelimit' => 1, |
20
|
|
|
|
|
|
|
'testcases' => 1, |
21
|
|
|
|
|
|
|
'maxscore' => 100, |
22
|
|
|
|
|
|
|
'lang' => 'pl', |
23
|
|
|
|
|
|
|
'sourcecode' => $path.'/t/03_judge01.pl', |
24
|
|
|
|
|
|
|
'compile' => 0, |
25
|
|
|
|
|
|
|
'userpath' => $path.'/t/usr/', |
26
|
|
|
|
|
|
|
'taskpath' => $path.'/t/task/', |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# compilation error |
30
|
1
|
|
|
|
|
9
|
my $r2 = { |
31
|
|
|
|
|
|
|
'rid' => 1, |
32
|
|
|
|
|
|
|
'timelimit' => 1, |
33
|
|
|
|
|
|
|
'testcases' => 1, |
34
|
|
|
|
|
|
|
'maxscore' => 100, |
35
|
|
|
|
|
|
|
'lang' => 'c', |
36
|
|
|
|
|
|
|
'sourcecode' => $path.'/t/03_judge02.c', |
37
|
|
|
|
|
|
|
'compile' => 1, |
38
|
|
|
|
|
|
|
'userpath' => $path.'/t/usr/', |
39
|
|
|
|
|
|
|
'taskpath' => $path.'/t/task/', |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# time limit |
43
|
1
|
|
|
|
|
9
|
my $r3 = { |
44
|
|
|
|
|
|
|
'rid' => 1, |
45
|
|
|
|
|
|
|
'timelimit' => 1, |
46
|
|
|
|
|
|
|
'testcases' => 1, |
47
|
|
|
|
|
|
|
'maxscore' => 100, |
48
|
|
|
|
|
|
|
'lang' => 'pl', |
49
|
|
|
|
|
|
|
'sourcecode' => $path.'/t/03_judge03.pl', |
50
|
|
|
|
|
|
|
'compile' => 0, |
51
|
|
|
|
|
|
|
'userpath' => $path.'/t/usr/', |
52
|
|
|
|
|
|
|
'taskpath' => $path.'/t/task/', |
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# wrong answer |
56
|
1
|
|
|
|
|
7
|
my $r4 = { |
57
|
|
|
|
|
|
|
'rid' => 1, |
58
|
|
|
|
|
|
|
'timelimit' => 1, |
59
|
|
|
|
|
|
|
'testcases' => 1, |
60
|
|
|
|
|
|
|
'maxscore' => 100, |
61
|
|
|
|
|
|
|
'lang' => 'pl', |
62
|
|
|
|
|
|
|
'sourcecode' => $path.'/t/03_judge04.pl', |
63
|
|
|
|
|
|
|
'compile' => 0, |
64
|
|
|
|
|
|
|
'userpath' => $path.'/t/usr/', |
65
|
|
|
|
|
|
|
'taskpath' => $path.'/t/task/', |
66
|
|
|
|
|
|
|
}; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# badword |
69
|
1
|
|
|
|
|
9
|
my $r5 = { |
70
|
|
|
|
|
|
|
'rid' => 1, |
71
|
|
|
|
|
|
|
'timelimit' => 1, |
72
|
|
|
|
|
|
|
'testcases' => 1, |
73
|
|
|
|
|
|
|
'maxscore' => 100, |
74
|
|
|
|
|
|
|
'lang' => 'pl', |
75
|
|
|
|
|
|
|
'sourcecode' => $path.'/t/03_judge05.pl', |
76
|
|
|
|
|
|
|
'compile' => 0, |
77
|
|
|
|
|
|
|
'userpath' => $path.'/t/usr/', |
78
|
|
|
|
|
|
|
'taskpath' => $path.'/t/task/', |
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
1
|
|
|
|
|
2
|
push(@foo, $r1); |
83
|
1
|
|
|
|
|
2
|
push(@foo, $r2); |
84
|
1
|
|
|
|
|
2
|
push(@foo, $r3); |
85
|
1
|
|
|
|
|
1
|
push(@foo, $r4); |
86
|
1
|
|
|
|
|
2
|
push(@foo, $r5); |
87
|
|
|
|
|
|
|
|
88
|
1
|
|
|
|
|
4
|
return @foo; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
# Simple update subroutine |
92
|
|
|
|
|
|
|
sub update { |
93
|
5
|
|
|
5
|
0
|
152
|
my $r = shift; |
94
|
|
|
|
|
|
|
|
95
|
5
|
|
|
|
|
22
|
return $r->{'comment'}; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |