-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.2.0 bump + release notes + docs (#109)
- Loading branch information
Showing
11 changed files
with
154 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. _v1_2_0: | ||
|
||
1.2.0 | ||
===== | ||
|
||
December 16, 2016 | ||
|
||
Bugfixes | ||
-------- | ||
|
||
- Fixed a regression when the final verdict of local grading of problems without subtasks is always AC. | ||
|
||
New features | ||
------------ | ||
|
||
- It is now possible to write a custom program that checks whether the contestant's output is correct (instead of just comparing it with the official output). This is called custom scorer program. | ||
- It is now possible not to generate test case output (``.out``) files. | ||
|
||
See :ref:`styles` for details on how to enable the above options. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ Release Notes | |
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
1_2_0 | ||
1_1_0 | ||
1_0_1 | ||
1_0_0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
.. _styles: | ||
|
||
Problem Styles | ||
============== | ||
|
||
Currently, **tcframe** supports only **batch**-style problems, where the solution is expected to read the test cases from the standard input and write the answers to the standard output. There are some configurable options to this behavior, which can be specified in the ``StyleConfig()`` method of the problem spec class. | ||
|
||
.. sourcecode:: cpp | ||
|
||
void StyleConfig() { | ||
// option specifications | ||
} | ||
|
||
The available options are as follows. | ||
|
||
Custom scorer | ||
------------- | ||
|
||
Enabled by calling ``CustomScorer()`` inside ``StyleConfig()``. | ||
|
||
A scorer is a program which decides the verdict of a test case. By default, the scorer is the simple ``diff`` program. If custom scorer is enabled, then you must provide the custom scorer program. | ||
|
||
The custom scorer will receive the following arguments: | ||
|
||
- argv[1]: test case input filename | ||
- argv[2]: test case output filename | ||
- argv[3]: contestant's produced output filename | ||
|
||
The custom scorer must print the test case verdict to the standard output, which is a line consisting of either: | ||
|
||
- ``AC``: indicates that the contestant's output is correct | ||
- ``WA``: indicates that the contestant's output is incorrect | ||
|
||
The custom scorer must be compiled prior test cases generation/local grading, and the execution command should be passed to the runner program as the ``--scorer`` option. For example: | ||
|
||
:: | ||
|
||
./runner grade --solution=./solution_alt --scorer=./my_custom_scorer | ||
|
||
The default scorer command is ``./scorer`` if not specified. | ||
|
||
Here is an example custom scorer which gives AC if the contestant's output differs not more than 1e-9 with the official output. | ||
|
||
.. sourcecode:: cpp | ||
|
||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int wa() { | ||
cout << "WA" << endl; | ||
return 0; | ||
} | ||
|
||
int ac() { | ||
cout << "AC" << endl; | ||
return 0; | ||
} | ||
|
||
int main(int argc, char* argv[]) { | ||
ifstream tc_in(argv[1]); | ||
ifstream tc_out(argv[2]); | ||
ifstream con_out(argv[3]); | ||
|
||
double tc_ans; | ||
tc_out >> tc_ans; | ||
|
||
double con_ans; | ||
if (!(con_out >> con_ans)) { | ||
return wa(); | ||
} | ||
|
||
if (abs(tc_ans - con_ans) < 1e-9) { | ||
return ac(); | ||
} else { | ||
return wa(); | ||
} | ||
} | ||
|
||
No output | ||
--------- | ||
|
||
Enabled by calling ``NoOutput()`` inside ``StyleConfig()``. | ||
|
||
Sometimes, a problem does not need test case output files (``.out``) because the scoring is done by a custom score alone. If this option is enabled, then ``.out`` files will not be generated, and it is not allowed to specify ``Output()`` in sample test cases. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ build() { | |
} | ||
|
||
version() { | ||
echo "tcframe 1.1.0" | ||
echo "tcframe 1.2.0" | ||
} | ||
|
||
if [ -z "$TCFRAME_HOME" ]; then | ||
|