Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for markdown statements. #191

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apt-get update && \
python3-minimal \
python3-pip \
python3-plastex \
python3-markdown \
python3-yaml \
sudo \
texlive-fonts-recommended \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,13 @@ The dependencies needed to *build/install* problemtools can be installed with:

And the dependencies needed to *run* problemtools can be installed with:

sudo apt install ghostscript libgmpxx4ldbl python-minimal python-pkg-resources python-plastex python-yaml texlive-fonts-recommended texlive-lang-cyrillic texlive-latex-extra texlive-plain-generic tidy
sudo apt install ghostscript libgmpxx4ldbl python3-minimal python-pkg-resources python3-plastex python3-markdown python3-yaml texlive-fonts-recommended texlive-lang-cyrillic texlive-latex-extra texlive-plain-generic tidy

### Fedora

On Fedora, these dependencies can be installed with:

sudo dnf install boost-regex gcc gmp-devel gmp-c++ python3 python3-pyyaml texlive-latex texlive-collection-fontsrecommended texlive-fancyhdr texlive-subfigure texlive-wrapfig texlive-import texlive-ulem texlive-xifthen texlive-overpic texlive-pbox tidy ghostscript
sudo dnf install boost-regex gcc gmp-devel gmp-c++ python3 python3-pyyaml python3-markdown texlive-latex texlive-collection-fontsrecommended texlive-fancyhdr texlive-subfigure texlive-wrapfig texlive-import texlive-ulem texlive-xifthen texlive-overpic texlive-pbox tidy ghostscript

Followed by:

Expand Down
1 change: 1 addition & 0 deletions admin/docker/Dockerfile.minimal
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN apt update && \
python3-minimal \
python3-yaml \
python3-plastex \
python3-markdown \
texlive-fonts-recommended \
texlive-lang-cyrillic \
texlive-latex-extra \
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Homepage: https://github.com/Kattis/problemtools

Package: kattis-problemtools
Architecture: any
Depends: ${shlibs:Depends}, ${python3:Depends}, ${misc:Depends}, python3-plastex, python-pkg-resources, texlive-plain-generic, texlive-fonts-recommended, texlive-latex-extra, texlive-lang-cyrillic, tidy, ghostscript
Depends: ${shlibs:Depends}, ${python3:Depends}, ${misc:Depends}, python3-plastex, python3-markdown, python-pkg-resources, texlive-plain-generic, texlive-fonts-recommended, texlive-latex-extra, texlive-lang-cyrillic, tidy, ghostscript
Recommends: gcc, g++
Description: Kattis Problem Tools
These are tools to manage and verify problem packages in the
Expand Down
9 changes: 9 additions & 0 deletions examples/different/problem_statement/problem.sv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Skriv ett program som beräknar differensen mellan icke-negativa heltal.

## Indata
Indatan består av flera testfall (minst \(1\) och som mest \(40\)), ett per rad.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I am overly fond of the \( and \) syntax for math mode in markdown.

Varje testfall består av ett par av heltal mellan \(0\) och \(10^{15}\) (inklusive).
Indatan avslutas med vid indatans slut (end of file).

## Utdata
För varje par av heltal i indatan, skriv ut en rad med absolutbeloppet av deras differens.
3 changes: 3 additions & 0 deletions examples/echo/data/sample/1.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hello
am
echo
6 changes: 6 additions & 0 deletions examples/echo/data/sample/1.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
hello
i
am
an
echo
5 changes: 5 additions & 0 deletions examples/echo/data/sample/2.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
only
these
words
are
correct
11 changes: 11 additions & 0 deletions examples/echo/data/sample/2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
10
only
if
these
oddindexed
words
appear
are
you
correct
output
5 changes: 5 additions & 0 deletions examples/echo/data/sample/testdata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
on_reject: continue
range: 0 0
accept_score: 0
grader_flags: first_error
input_validator_flags: nFive=0
3 changes: 3 additions & 0 deletions examples/echo/data/secret/subtask1/1.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a
c
e
6 changes: 6 additions & 0 deletions examples/echo/data/secret/subtask1/1.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
a
b
c
d
e
3 changes: 3 additions & 0 deletions examples/echo/data/secret/subtask1/2.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
6 changes: 6 additions & 0 deletions examples/echo/data/secret/subtask1/2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3 changes: 3 additions & 0 deletions examples/echo/data/secret/subtask1/3.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testdata
fun
write
6 changes: 6 additions & 0 deletions examples/echo/data/secret/subtask1/3.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
testdata
is
fun
to
write
5 changes: 5 additions & 0 deletions examples/echo/data/secret/subtask1/testdata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
on_reject: break
accept_score: 1
range: 0 1
grader_flags: min
input_validator_flags: nFive=1
1 change: 1 addition & 0 deletions examples/echo/data/secret/subtask2/01.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lfqxnsarqnsonfnrspgcdnvhcdacwtxqxpfqjbdhworqtcscpzxyaevsktuzjdbkhxlaqmc
2 changes: 2 additions & 0 deletions examples/echo/data/secret/subtask2/01.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1
lfqxnsarqnsonfnrspgcdnvhcdacwtxqxpfqjbdhworqtcscpzxyaevsktuzjdbkhxlaqmc
1 change: 1 addition & 0 deletions examples/echo/data/secret/subtask2/02.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sadswmlfyrzyuzurmawdpqjeorkjxrbigpdgurpbrpwvnwhpwzgsgwgrenbytkhyydepspqkmwekbcuyltbscfynzhjm
3 changes: 3 additions & 0 deletions examples/echo/data/secret/subtask2/02.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2
sadswmlfyrzyuzurmawdpqjeorkjxrbigpdgurpbrpwvnwhpwzgsgwgrenbytkhyydepspqkmwekbcuyltbscfynzhjm
haieueifbuuuxpkcxojnepciypyttbnijwufdjopamhxv
2 changes: 2 additions & 0 deletions examples/echo/data/secret/subtask2/03.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ukne
hzilgamqhyahjclmuyjvejunnanjuxflviaeiyzpczfojvcodlujutzwbsyavodbuosqoatpagssnogkynjsm
4 changes: 4 additions & 0 deletions examples/echo/data/secret/subtask2/03.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3
ukne
zliqslrpwrnlnlnogfcnswqbnjbqxrlmtjebyllyolrrhzfspgumodkfnyomn
hzilgamqhyahjclmuyjvejunnanjuxflviaeiyzpczfojvcodlujutzwbsyavodbuosqoatpagssnogkynjsm
2 changes: 2 additions & 0 deletions examples/echo/data/secret/subtask2/04.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vbrhnsjugbscwghs
wrqujghiseuvcrzomktwkljyrvsngudxtjzjankgphmcwewcklgfqrzvscpjjmigjpuid
5 changes: 5 additions & 0 deletions examples/echo/data/secret/subtask2/04.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
4
vbrhnsjugbscwghs
dezpmjwllgbfirkbrgyznqdhfzyxggwkraopba
wrqujghiseuvcrzomktwkljyrvsngudxtjzjankgphmcwewcklgfqrzvscpjjmigjpuid
bglrjlbelhezdfciayabmsusdcrsnrzar
3 changes: 3 additions & 0 deletions examples/echo/data/secret/subtask2/05.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
irklktbawab
fclqvhrogqr
qqmzocleumdgvlakmuchrdyefveruoffmmqgqhlabsmvqgpkdmhqwzeh
6 changes: 6 additions & 0 deletions examples/echo/data/secret/subtask2/05.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
irklktbawab
jvzuldycrv
fclqvhrogqr
perenlqdlrjadjjshtcjjgtxisykhnvfzerpopetifrulhuxb
qqmzocleumdgvlakmuchrdyefveruoffmmqgqhlabsmvqgpkdmhqwzeh
3 changes: 3 additions & 0 deletions examples/echo/data/secret/subtask2/06.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cpeylvrgilhhknuiqacizawqnhlwohatcfxcxrsrwwboplxzwffnmc
npsyxizmkmbhctrjvevjffwpivhfzjwbajeebbdwqparvsrmnypohqkyignenyfnolzaxrpcupof
shcsjdzoewvdaaubtpogvlfbvyzoxyqwonqvnfberoapbivdomlxngfpfcpwuknmzjmwthqacax
7 changes: 7 additions & 0 deletions examples/echo/data/secret/subtask2/06.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
6
cpeylvrgilhhknuiqacizawqnhlwohatcfxcxrsrwwboplxzwffnmc
mvvfbckehiddcdgzahaqvcsygytwtkoticelntkfpeqihaxczolvk
npsyxizmkmbhctrjvevjffwpivhfzjwbajeebbdwqparvsrmnypohqkyignenyfnolzaxrpcupof
ttj
shcsjdzoewvdaaubtpogvlfbvyzoxyqwonqvnfberoapbivdomlxngfpfcpwuknmzjmwthqacax
auhkxxmljnnkzfcuxtqwdlosbrbplklwbidpnsvdaimaxxdnpuurfqylqybaxlybqbbknrcvfuvkwuvnqdak
4 changes: 4 additions & 0 deletions examples/echo/data/secret/subtask2/07.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vqbkewxjyflzwuzcprdvdmoquiqz
klseqgeziclrbkuflydmyxttlipwutnychfyuhcdbolikfmdqrxjbtlyfqazwaogqvbmgxnjcowzspliupjnk
oyibwjayadunwawrpjjtewsksrsvfpbqmfwkchisqh
vticcfq
8 changes: 8 additions & 0 deletions examples/echo/data/secret/subtask2/07.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
7
vqbkewxjyflzwuzcprdvdmoquiqz
nxiipmvrhjmmdpivdgchvtokirceudfoejawvdzrgiiizwuqotvhvttahmmbqvzkfwqvzklxuk
klseqgeziclrbkuflydmyxttlipwutnychfyuhcdbolikfmdqrxjbtlyfqazwaogqvbmgxnjcowzspliupjnk
gnmxpokvkotwddyqgnyihfwuvrfkhmlfaphmmyhjcgvuoocxxwmpgfozbhfwdnixlntspxxpujdbpwfl
oyibwjayadunwawrpjjtewsksrsvfpbqmfwkchisqh
tjhybleiurwulxvuxiaepnbfxthhguwkmjnhhjvsvuuqugqqlvhghzspigwhcwpj
vticcfq
4 changes: 4 additions & 0 deletions examples/echo/data/secret/subtask2/08.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
deqnzpbnsglenccnxbfftyozqkxkuxdsswoyxrpqzfrjw
ivlz
ufdykwdhtcuycogobloygqpdqvustnkhxlfqbxrwtencnamvplvjsoxefkkfysnjqtlsgvdmftmgxkzcvjonxftclnoeyi
hqgidntdapjijdbyffddxuxbgkbskljwtdbodbnaxfhvyqrqmhplu
9 changes: 9 additions & 0 deletions examples/echo/data/secret/subtask2/08.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
8
deqnzpbnsglenccnxbfftyozqkxkuxdsswoyxrpqzfrjw
lfekwxymhixfiywnkajsxhzhnsamfkpbnapdn
ivlz
vultxfpcljsnzhiuluotznaaxlnrqgowizkjpfknrpqjimvt
ufdykwdhtcuycogobloygqpdqvustnkhxlfqbxrwtencnamvplvjsoxefkkfysnjqtlsgvdmftmgxkzcvjonxftclnoeyi
gpbbrzgrxaffhkhszwqsnbhnfawfqsrrqnacdjspvdfbhguutebf
hqgidntdapjijdbyffddxuxbgkbskljwtdbodbnaxfhvyqrqmhplu
zzatbijlsrycjytezjqvnkycchtuugygrbouvonefwdiuyfd
5 changes: 5 additions & 0 deletions examples/echo/data/secret/subtask2/09.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ywkmbqkkclwyvtwxdpcsehboqhoppqjvclxxvtcpsuodxczq
qcjncscqtrtlabzjcuksjtyhxzzkwhkiohusxuso
jqcbcdwsqoikrzvcitbzuqsluilgvdjjnjxjqfbjlnzslzukfcxgwgsgpuvvcvvaewkdcglrkx
pcgamvgaclmsgflrvvtubflyezombfkuowzixlqlpieljyxulvbmxdkaazudiltxaktbkfsjlbhpbkghdw
jabtuprvwrtxhoyqqjpoxwyeecsdfsdmf
10 changes: 10 additions & 0 deletions examples/echo/data/secret/subtask2/09.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
9
ywkmbqkkclwyvtwxdpcsehboqhoppqjvclxxvtcpsuodxczq
wiswindhsujxyfospysxdhxcscwpcwsqwcmqfetxlyhtqwdbljggwexeogngnj
qcjncscqtrtlabzjcuksjtyhxzzkwhkiohusxuso
wdtcnphtacocstxq
jqcbcdwsqoikrzvcitbzuqsluilgvdjjnjxjqfbjlnzslzukfcxgwgsgpuvvcvvaewkdcglrkx
rvhxjnjbgneobaiokpgdcozeifokfzocj
pcgamvgaclmsgflrvvtubflyezombfkuowzixlqlpieljyxulvbmxdkaazudiltxaktbkfsjlbhpbkghdw
cghkfphphurvlfkggecrejynkimepdrfztbbuurhab
jabtuprvwrtxhoyqqjpoxwyeecsdfsdmf
5 changes: 5 additions & 0 deletions examples/echo/data/secret/subtask2/10.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
xtrsypuaepzhccpetemqdhmcqxfodgdvratymblu
ahpeewdydhwnzroofgqosqpuogtksnxvgmcttqifkaesfynuqoyybgdlcdavgxpqzqpolmbfvbrsephlyetqzzssxr
shgumshytseusbxaltfupadvgsofzzynvyizkv
epzdnrhplcidomwd
duqrzupszqiepbdknabjyqiqwnzwnurnkzvyuekigteqmbviccczhzbyjtvdaoqxfwtqrypdfqjqhurpzpkgxwlvouprkhjcn
11 changes: 11 additions & 0 deletions examples/echo/data/secret/subtask2/10.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
10
xtrsypuaepzhccpetemqdhmcqxfodgdvratymblu
ypthphgovonyeyvlhplxhoqokfsydnuthhalvigycjsvftsluubakxmsoiymxnuacfypkihbhbxrfqscaegd
ahpeewdydhwnzroofgqosqpuogtksnxvgmcttqifkaesfynuqoyybgdlcdavgxpqzqpolmbfvbrsephlyetqzzssxr
jwticnnpvgvundxanfypelksswwoteddqjgdkjmjalynmjkuimskqlzsbpxndhkcgrrywddahqcyxmpazmdscifxwcmkqbu
shgumshytseusbxaltfupadvgsofzzynvyizkv
rgidvfmdosdvmukttgrseffhmhwjjgrtmleoebfvulqbodxszbkhbrytandntcrspuv
epzdnrhplcidomwd
xpngzvutfhsdzxnbtyqxobg
duqrzupszqiepbdknabjyqiqwnzwnurnkzvyuekigteqmbviccczhzbyjtvdaoqxfwtqrypdfqjqhurpzpkgxwlvouprkhjcn
foxtfbqiywcbypfzrzaxbothhhevfghapr
5 changes: 5 additions & 0 deletions examples/echo/data/secret/subtask2/testdata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
on_reject: break
accept_score: 1
range: 0 1
grader_flags: min
input_validator_flags: nFive=0
3 changes: 3 additions & 0 deletions examples/echo/data/secret/testdata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
on_reject: continue
range: 0 2
grader_flags: first_error accept_if_any_accepted
3 changes: 3 additions & 0 deletions examples/echo/data/testdata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
on_reject: continue
range: 0 2
grader_flags: ignore_sample
15 changes: 15 additions & 0 deletions examples/echo/input_format_validators/validator/validator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "validator.h"


void run() {
const bool nFive = Arg("nFive", 0);
int N = Int(1, 10); Endl();
assert(!nFive || N == 5);
for (int i = 0; i < N; i++) {
string s = Line();
for (auto it : s) {
assert('a' <= it && it <= 'z');
}
}
Eof();
}
Loading