rbx.cp 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. rbx/__init__.py +0 -0
  2. rbx/annotations.py +127 -0
  3. rbx/autoenum.py +333 -0
  4. rbx/box/__init__.py +0 -0
  5. rbx/box/builder.py +77 -0
  6. rbx/box/cd.py +37 -0
  7. rbx/box/checkers.py +134 -0
  8. rbx/box/code.py +185 -0
  9. rbx/box/compile.py +56 -0
  10. rbx/box/conftest.py +42 -0
  11. rbx/box/contest/__init__.py +0 -0
  12. rbx/box/contest/build_contest_statements.py +347 -0
  13. rbx/box/contest/contest_package.py +76 -0
  14. rbx/box/contest/contest_utils.py +20 -0
  15. rbx/box/contest/main.py +179 -0
  16. rbx/box/contest/schema.py +155 -0
  17. rbx/box/contest/statements.py +82 -0
  18. rbx/box/creation.py +72 -0
  19. rbx/box/download.py +64 -0
  20. rbx/box/environment.py +345 -0
  21. rbx/box/extensions.py +26 -0
  22. rbx/box/generators.py +478 -0
  23. rbx/box/generators_test.py +63 -0
  24. rbx/box/main.py +449 -0
  25. rbx/box/package.py +316 -0
  26. rbx/box/packaging/boca/extension.py +27 -0
  27. rbx/box/packaging/boca/packager.py +245 -0
  28. rbx/box/packaging/contest_main.py +82 -0
  29. rbx/box/packaging/main.py +68 -0
  30. rbx/box/packaging/packager.py +117 -0
  31. rbx/box/packaging/polygon/packager.py +320 -0
  32. rbx/box/packaging/polygon/test.py +81 -0
  33. rbx/box/packaging/polygon/xml_schema.py +106 -0
  34. rbx/box/presets/__init__.py +503 -0
  35. rbx/box/presets/fetch.py +70 -0
  36. rbx/box/presets/lock_schema.py +20 -0
  37. rbx/box/presets/schema.py +59 -0
  38. rbx/box/schema.py +394 -0
  39. rbx/box/solutions.py +792 -0
  40. rbx/box/solutions_test.py +41 -0
  41. rbx/box/statements/__init__.py +0 -0
  42. rbx/box/statements/build_statements.py +359 -0
  43. rbx/box/statements/builders.py +375 -0
  44. rbx/box/statements/joiners.py +113 -0
  45. rbx/box/statements/latex.py +47 -0
  46. rbx/box/statements/latex_jinja.py +214 -0
  47. rbx/box/statements/schema.py +138 -0
  48. rbx/box/stresses.py +292 -0
  49. rbx/box/stressing/__init__.py +0 -0
  50. rbx/box/stressing/finder_parser.py +359 -0
  51. rbx/box/stressing/generator_parser.py +258 -0
  52. rbx/box/testcases.py +54 -0
  53. rbx/box/ui/__init__.py +0 -0
  54. rbx/box/ui/captured_log.py +372 -0
  55. rbx/box/ui/css/app.tcss +48 -0
  56. rbx/box/ui/main.py +38 -0
  57. rbx/box/ui/run.py +209 -0
  58. rbx/box/validators.py +245 -0
  59. rbx/box/validators_test.py +15 -0
  60. rbx/checker.py +128 -0
  61. rbx/clone.py +197 -0
  62. rbx/config.py +271 -0
  63. rbx/conftest.py +38 -0
  64. rbx/console.py +27 -0
  65. rbx/create.py +37 -0
  66. rbx/edit.py +24 -0
  67. rbx/grading/__init__.py +0 -0
  68. rbx/grading/caching.py +356 -0
  69. rbx/grading/conftest.py +33 -0
  70. rbx/grading/judge/__init__.py +0 -0
  71. rbx/grading/judge/cacher.py +503 -0
  72. rbx/grading/judge/digester.py +35 -0
  73. rbx/grading/judge/sandbox.py +748 -0
  74. rbx/grading/judge/sandboxes/__init__.py +0 -0
  75. rbx/grading/judge/sandboxes/isolate.py +683 -0
  76. rbx/grading/judge/sandboxes/stupid_sandbox.py +310 -0
  77. rbx/grading/judge/sandboxes/timeit.py +217 -0
  78. rbx/grading/judge/storage.py +284 -0
  79. rbx/grading/judge/test.py +38 -0
  80. rbx/grading/judge/testiso.py +54 -0
  81. rbx/grading/steps.py +522 -0
  82. rbx/grading/steps_with_caching.py +59 -0
  83. rbx/grading/steps_with_caching_run_test.py +429 -0
  84. rbx/grading_utils.py +148 -0
  85. rbx/hydration.py +101 -0
  86. rbx/main.py +122 -0
  87. rbx/metadata.py +105 -0
  88. rbx/providers/__init__.py +43 -0
  89. rbx/providers/codeforces.py +73 -0
  90. rbx/providers/provider.py +26 -0
  91. rbx/resources/checkers/boilerplate.cpp +20 -0
  92. rbx/resources/default_config.json +48 -0
  93. rbx/resources/envs/default.rbx.yml +37 -0
  94. rbx/resources/envs/isolate.rbx.yml +37 -0
  95. rbx/resources/packagers/boca/checker.sh +43 -0
  96. rbx/resources/packagers/boca/compare +53 -0
  97. rbx/resources/packagers/boca/compile/c +172 -0
  98. rbx/resources/packagers/boca/compile/cc +173 -0
  99. rbx/resources/packagers/boca/compile/cpp +172 -0
  100. rbx/resources/packagers/boca/compile/java +194 -0
  101. rbx/resources/packagers/boca/compile/kt +155 -0
  102. rbx/resources/packagers/boca/compile/pas +172 -0
  103. rbx/resources/packagers/boca/compile/py2 +173 -0
  104. rbx/resources/packagers/boca/compile/py3 +173 -0
  105. rbx/resources/packagers/boca/run/c +128 -0
  106. rbx/resources/packagers/boca/run/cc +128 -0
  107. rbx/resources/packagers/boca/run/cpp +128 -0
  108. rbx/resources/packagers/boca/run/java +194 -0
  109. rbx/resources/packagers/boca/run/kt +159 -0
  110. rbx/resources/packagers/boca/run/py2 +166 -0
  111. rbx/resources/packagers/boca/run/py3 +166 -0
  112. rbx/resources/presets/default/contest/contest.rbx.yml +14 -0
  113. rbx/resources/presets/default/contest/statement/contest.rbx.tex +97 -0
  114. rbx/resources/presets/default/contest/statement/olymp.sty +250 -0
  115. rbx/resources/presets/default/contest/statement/template.rbx.tex +42 -0
  116. rbx/resources/presets/default/preset.rbx.yml +12 -0
  117. rbx/resources/presets/default/problem/.gitignore +6 -0
  118. rbx/resources/presets/default/problem/gen.cpp +9 -0
  119. rbx/resources/presets/default/problem/problem.rbx.yml +44 -0
  120. rbx/resources/presets/default/problem/random.py +3 -0
  121. rbx/resources/presets/default/problem/random.txt +2 -0
  122. rbx/resources/presets/default/problem/sols/main.cpp +9 -0
  123. rbx/resources/presets/default/problem/sols/slow.cpp +15 -0
  124. rbx/resources/presets/default/problem/sols/wa.cpp +9 -0
  125. rbx/resources/presets/default/problem/statement/olymp.sty +250 -0
  126. rbx/resources/presets/default/problem/statement/projecao.png +0 -0
  127. rbx/resources/presets/default/problem/statement/statement.rbx.tex +18 -0
  128. rbx/resources/presets/default/problem/statement/template.rbx.tex +89 -0
  129. rbx/resources/presets/default/problem/tests/samples/000.in +1 -0
  130. rbx/resources/presets/default/problem/tests/samples/001.in +1 -0
  131. rbx/resources/presets/default/problem/validator.cpp +16 -0
  132. rbx/resources/presets/default/problem/wcmp.cpp +34 -0
  133. rbx/resources/templates/template.cpp +19 -0
  134. rbx/run.py +45 -0
  135. rbx/schema.py +64 -0
  136. rbx/submit.py +61 -0
  137. rbx/submitors/__init__.py +18 -0
  138. rbx/submitors/codeforces.py +120 -0
  139. rbx/submitors/submitor.py +25 -0
  140. rbx/test.py +347 -0
  141. rbx/testcase.py +70 -0
  142. rbx/testcase_rendering.py +79 -0
  143. rbx/testdata/box1/gen1.cpp +7 -0
  144. rbx/testdata/box1/gen2.cpp +9 -0
  145. rbx/testdata/box1/genScript.py +2 -0
  146. rbx/testdata/box1/hard-tle.sol.cpp +26 -0
  147. rbx/testdata/box1/ole.cpp +17 -0
  148. rbx/testdata/box1/problem.rbx.yml +39 -0
  149. rbx/testdata/box1/re.sol.cpp +23 -0
  150. rbx/testdata/box1/sol.cpp +22 -0
  151. rbx/testdata/box1/tests/1.in +1 -0
  152. rbx/testdata/box1/tle-and-incorrect.sol.cpp +33 -0
  153. rbx/testdata/box1/tle.sol.cpp +35 -0
  154. rbx/testdata/box1/validator.cpp +11 -0
  155. rbx/testdata/box1/wa.sol.cpp +22 -0
  156. rbx/testdata/caching/executable.py +1 -0
  157. rbx/testdata/compatible +0 -0
  158. rbx/testing_utils.py +65 -0
  159. rbx/utils.py +162 -0
  160. rbx_cp-0.5.0.dist-info/LICENSE +201 -0
  161. rbx_cp-0.5.0.dist-info/METADATA +89 -0
  162. rbx_cp-0.5.0.dist-info/RECORD +164 -0
  163. rbx_cp-0.5.0.dist-info/WHEEL +4 -0
  164. rbx_cp-0.5.0.dist-info/entry_points.txt +4 -0
@@ -0,0 +1,14 @@
1
+ # Add problems by running `rbx contest add <problem-name> <short-name>`
2
+
3
+ name: "new-contest"
4
+ statements:
5
+ - title: "New contest"
6
+ language: en
7
+ path: 'statement/contest.rbx.tex'
8
+ type: 'jinja-tex'
9
+ assets: ['statement/olymp.sty', 'statement/*.png']
10
+ joiner: {type: 'tex2pdf'}
11
+ override:
12
+ configure:
13
+ - type: 'rbx-tex' # Convert rbxTeX to TeX
14
+ template: 'statement/template.rbx.tex'
@@ -0,0 +1,97 @@
1
+
2
+ \documentclass[titlepage, oneside, a4paper]{article}
3
+
4
+ \usepackage {import}
5
+ \usepackage[margin=25mm, left=17mm, right=17mm]{geometry}
6
+ \usepackage[utf8]{inputenc}
7
+ \usepackage[english]{babel}
8
+ \usepackage{amsmath}
9
+ \usepackage{amssymb}
10
+ \usepackage{fancyhdr}
11
+ \usepackage{comment}
12
+ \usepackage{olymp}
13
+ \usepackage{epigraph}
14
+ \usepackage{expdlist}
15
+ \usepackage{graphicx}
16
+ \usepackage{ulem}
17
+ \usepackage{lastpage}
18
+
19
+ %- for problem in problems
20
+ %- if problem.blocks.preamble is defined
21
+ \VAR{problem.blocks.preamble}
22
+ %- endif
23
+ %- endfor
24
+
25
+ \def\showSourceFileName{1}
26
+ \newif\ifintentionallyblankpages % comment this out to add blank pages
27
+
28
+ \pagestyle{fancy}
29
+ \fancyhf{}
30
+ \renewcommand{\footrulewidth}{0.4pt}
31
+
32
+ %- if contest is defined
33
+ \title{\VAR{contest.title or ""}}
34
+ \author{\VAR{contest.location if contest.location is defined else ""}}
35
+ \date{\VAR{contest.date if contest.date is defined else ""}}
36
+ %- else
37
+ \title{}
38
+ \author{}
39
+ \date{}
40
+ %- endif
41
+
42
+ \makeatletter
43
+ \let\newtitle\@title
44
+ \let\newauthor\@author
45
+ \let\newdate\@date
46
+ \makeatother
47
+
48
+ \rhead{\newtitle}
49
+ \lhead{\newauthor}
50
+ \lfoot{\newdate}
51
+ \rfoot{\thepage}
52
+
53
+ \begin{document}
54
+
55
+ %- if contest is defined
56
+ \begin{frontpage}{\newtitle}{\newauthor}{\newdate}
57
+ \begin{itemize}
58
+ \item Sobre a prova:
59
+ \begin{enumerate}
60
+ \item A prova tem duração de 5 horas;
61
+ \end{enumerate}
62
+ \item Sobre a entrada:
63
+ \begin{enumerate}
64
+ \item A entrada do seu programa deve ser lida da entrada padrão (standard input);
65
+ \item Quando uma linha da entrada contém vários valores, estes são separados por um único espaço em branco, a menos que explicitado o contrário no enunciado do problema;
66
+ \item Toda linha da entrada terminará com um caractere final-de-linha.
67
+ \end{enumerate}
68
+
69
+ \item Sobre a saída:
70
+ \begin{enumerate}
71
+ \item A saída de seu programa deve ser escrita na saída padrão;
72
+ \item Quando uma linha da saída contém vários valores, estes devem ser separados por um único espaço em branco, a menos que explicitado o contrário no enunciado do problema;
73
+ \item Toda linha da saída deve terminar com um caractere final-de-linha.
74
+ \end{enumerate}
75
+
76
+ \item Sobre as submissões:
77
+ \begin{enumerate}
78
+ \item Você deve submeter o código fonte das suas soluções;
79
+ \item Os comandos utilizados para compilação serão:
80
+ \begin{enumerate}
81
+ %- for language in languages:
82
+ \item \VAR{language.name | escape}: \VAR{language.command | escape}
83
+ %- endfor
84
+ \end{enumerate}
85
+ \item Para linguagem Java, o nome da classe principal do arquivo deve ser \textbf{Main}. A classe deve ser pública.
86
+ \end{enumerate}
87
+ \centering\vspace*{\fill}\textbf{Este caderno contém \VAR{problems | length} problema(s) e \pageref{LastPage} página(s)} \\
88
+ \vspace*{\fill}
89
+ \end{itemize}
90
+ \end{frontpage}
91
+ %- endif
92
+
93
+ %- for problem in problems
94
+ \subimport{\VAR{problem.path | parent}/}{\VAR{problem.path | stem}}
95
+ %- endfor
96
+
97
+ \end{document}
@@ -0,0 +1,250 @@
1
+ % Copyright (c) 2005-2013 Olymp.sty Developers Group.
2
+ % See https://github.com/GassaFM/olymp.sty/blob/master/AUTHORS
3
+ % for the complete list of authors.
4
+
5
+ %\ProvidesPackage{olymp}
6
+ \usepackage{verbatim}
7
+ \usepackage{xstring}
8
+
9
+ % \makeatletter
10
+ % \newcommand\FirstWord[1]{\@firstword#1 \@nil}%
11
+ % \def\@firstword#1 #2\@nil{\@removecomma#1,\@nil}%
12
+ % \def\@removecomma#1,#2\@nil{\@removeperiod#1.\@nil}
13
+ % \def\@removeperiod#1.#2\@nil{\@removesemicolon#1;\@nil}
14
+ % \def\@removesemicolon#1;#2\@nil{#1}
15
+ % \makeatother
16
+ \newcommand\FirstWord[1]{#1}
17
+
18
+ \ProcessOptions\relax
19
+
20
+ \setlength{\parindent}{0pt}
21
+ \setlength{\parskip}{0.8em}
22
+
23
+ % contest keywords definitions
24
+ \def\conProblemTutorial{Problem Tutorial}
25
+ \def\conProblem{Problem}
26
+ \def\conProblemAuthor{Author:}
27
+ \def\conProblemDeveloper{Developer:}
28
+ \def\conProblemOrigin{Origin:}
29
+ \def\conInputFileName{Input file:}
30
+ \def\conOutputFileName{Output file:}
31
+ \def\conTimeLimit{Time limit:}
32
+ \def\conMemoryLimit{Memory limit:}
33
+ \def\conFeedback{Feedback:}
34
+ \def\constdin{standard input}
35
+ \def\constdout{standard output}
36
+ \def\conSpecification{Specification}
37
+ \def\conInteraction{Interaction Protocol}
38
+ \def\conInput{Input}
39
+ \def\conOutput{Output}
40
+ \def\conExample{Example}
41
+ \def\conExamples{Examples}
42
+ \def\conExampleNotes{Notes}
43
+ \def\conExplanation{Explanation}
44
+ \def\conExplanations{Explanations}
45
+ \def\conIllustration{Illustration}
46
+ \def\conScoring{Scoring}
47
+ \def\conNote{Note}
48
+ \def\conNotes{Notes}
49
+ \def\conConstraints{Constraints}
50
+ \def\conversion{version}
51
+ \def\conrevision{revision}
52
+ \def\conSubtaskOne{Subtask 1}
53
+ \def\conSubtaskTwo{Subtask 2}
54
+ \def\conSubtaskThree{Subtask 3}
55
+ \def\conSubtaskFour{Subtask 4}
56
+ \def\conSubtaskFive{Subtask 5}
57
+ \def\conSubtaskSix{Subtask 6}
58
+ \def\conSubtask{Subtask}
59
+ \def\conpoints{points}
60
+ \def\conPage{Page}
61
+ \def\conof{of}
62
+ \def\connotstated{not stated}
63
+ \def\conIntentionallyBlankPage{This page is intentionally left blank}
64
+ \def\conTimeSuffix{s}
65
+ \def\conMemorySufix{mb}
66
+
67
+ % fancyhdr
68
+
69
+ % font
70
+
71
+ \newcommand{\afterfrontpage}{
72
+ \vspace*{\fill}
73
+ \begin{center}
74
+ \problemheadfont\conIntentionallyBlankPage
75
+ \end{center}
76
+ \vspace*{\fill}
77
+ \clearpage
78
+ }
79
+ \newcommand{\problemheadfont}{\LARGE}
80
+ \newcommand{\problemsectionfont}{\Large}
81
+ \newcommand{\problemtextfont}{\normalsize}
82
+ \newcommand{\beforeproblemsectioncaption}{\smallbreak\smallskip}
83
+ \newcommand{\afterproblemsectioncaption}{\smallskip}
84
+ \newcommand{\problemend}{
85
+ \clearpage
86
+ \ifintentionallyblankpages
87
+ \ifodd\value{page}
88
+ \else
89
+ \afterfrontpage
90
+ \fi
91
+ \fi
92
+ }
93
+ \def\presectionspacing{\hspace{3mm}}
94
+
95
+ % section commands from olymp
96
+
97
+ \newcommand{\createsection}{\@newsection}
98
+
99
+ \def\@newsection#1#2{\DeclareRobustCommand{#1}{
100
+ {\beforeproblemsectioncaption\bf\problemsectionfont\presectionspacing{#2}}
101
+ \nopagebreak\par\afterproblemsectioncaption}
102
+ }
103
+
104
+ \newcommand{\createsectionpar}{\@newsectionpar}
105
+
106
+ \def\@newsectionpar#1#2{\DeclareRobustCommand{#1}[1]{
107
+ {\beforeproblemsectioncaption\bf\problemsectionfont{#2~##1}}
108
+ \nopagebreak\par\afterproblemsectioncaption}
109
+ }
110
+
111
+ \newcommand{\createsectionpartwo}{\@newsectionpartwo}
112
+
113
+ \def\@newsectionpartwo#1#2#3{\DeclareRobustCommand{#1}[2]{
114
+ {\beforeproblemsectioncaption\problemsectionfont{\textbf{#2}~\textbf{##1}~(##2~#3)}}
115
+ \nopagebreak\par\afterproblemsectioncaption}
116
+ }
117
+
118
+ \createsection{\Instructions}{\conInstructions}
119
+ \createsection{\Specification}{\conSpecification}
120
+ \createsection{\Interaction}{\conInteraction}
121
+ \createsection{\InputFile}{\conInput}
122
+ \createsection{\OutputFile}{\conOutput}
123
+ \createsection{\Example}{\conExample}
124
+ \createsection{\Examples}{\conExamples}
125
+ \createsection{\Explanation}{\conExplanation}
126
+ \createsection{\Explanations}{\conExplanations}
127
+ \createsection{\Illustration}{\conIllustration}
128
+ \createsection{\Scoring}{\conScoring}
129
+ \createsection{\Note}{\conNote}
130
+ \createsection{\Notes}{\conNotes}
131
+ \createsection{\Constraints}{\conConstraints}
132
+ \createsection{\SubtaskOne}{\conSubtaskOne}
133
+ \createsection{\SubtaskTwo}{\conSubtaskTwo}
134
+ \createsection{\SubtaskThree}{\conSubtaskThree}
135
+ \createsection{\SubtaskFour}{\conSubtaskFour}
136
+ \createsection{\SubtaskFive}{\conSubtaskFive}
137
+ \createsection{\SubtaskSix}{\conSubtaskSix}
138
+ \createsectionpar{\Subtask}{\conSubtask}
139
+ \createsectionpartwo{\SubtaskWithCost}{\conSubtask}{\conpoints}
140
+ \createsection{\Editorial}{\conEditorial}
141
+
142
+ % frontpage
143
+ \newenvironment{frontpage}[3]{
144
+ \thispagestyle{empty}
145
+ {\centering
146
+ \noindent\rule{18cm}{0.4pt}
147
+
148
+ \vspace{1cm}
149
+ %\includegraphics[width=0.15\textwidth]{example-image-1x1}\par\vspace{1cm}
150
+ {\LARGE #1\par}
151
+ %\vspace{1cm}
152
+ {\Large #2\par}
153
+ \vspace{1cm}}
154
+ \def\thisFrontPageDate{#3}
155
+ \Instructions
156
+ }{
157
+ \vspace*{\fill}
158
+ \centering{\Large \thisFrontPageDate\par}
159
+ \centering\noindent\rule{18cm}{0.4pt}
160
+ \newpage
161
+ }
162
+
163
+ % problem
164
+ \newcounter{ProblemCounter}
165
+
166
+ \newenvironment{problem}[6][]{
167
+
168
+ \def\ProblemLetter{#1}
169
+ \stepcounter{ProblemCounter}
170
+ \begin{center}
171
+ \ifx\ProblemLetter\empty
172
+ \else
173
+ \problemtextfont\textbf{\conProblem\ \ProblemLetter} \\
174
+ \fi
175
+ \problemheadfont\textsf{#2} \\
176
+ \ifx#5\empty
177
+ \else
178
+ \problemtextfont{\conTimeLimit\ #5} \\
179
+ \fi
180
+ \ifx#6\empty
181
+ \else
182
+ \problemtextfont{\conMemoryLimit\ #6} \\
183
+ \fi
184
+ %\problemtextfont{\conSourceFileName\ \ProblemLetter\ \conSourceExts} \\
185
+ \vspace{0.3cm}
186
+ \noindent\rule{16cm}{0.4pt}
187
+ \end{center}
188
+ \problemtextfont
189
+ \newcommand{\InputFileName}{#3}
190
+ \newcommand{\OutputFileName}{#4}
191
+ }{\problemend}
192
+
193
+ % examples
194
+ % -- Setup sizes --
195
+ \newlength{\thelinewidth}
196
+ \newlength{\exmpwidinf}
197
+ \newlength{\exmpwidouf}
198
+ \newlength{\exmpwidewid}
199
+ \newlength{\exmpthreewidinf}
200
+ \newlength{\exmpthreewidouf}
201
+ \newlength{\exmpthreewidnote}
202
+
203
+ \thelinewidth=\textwidth
204
+ \exmpwidinf=0.43\thelinewidth
205
+ \exmpwidouf=0.43\thelinewidth
206
+ \exmpwidewid=0.9\thelinewidth
207
+ \exmpthreewidinf=0.28\thelinewidth
208
+ \exmpthreewidouf=0.28\thelinewidth
209
+ \exmpthreewidnote=0.30\thelinewidth
210
+
211
+ \def\s@tm@cr@s{
212
+ \def\widthin##1{\exmpwidinf=##1\relax}
213
+ \def\widthout##1{\exmpwidouf=##1\relax}
214
+ \def\stretchin##1{\advance\exmpwidinf by ##1\relax}
215
+ \def\stretchout##1{\advance\exmpwidouf by ##1\relax}
216
+ \@ifstar{
217
+ \error Star must not be used in example environment any more
218
+ }
219
+ }
220
+
221
+ % This is magic, which delete space after verbatiminput
222
+ \addto@hook{\every@verbatim}{\topsep=0pt\relax}
223
+
224
+ \newenvironment{example}[1][]{
225
+ \s@tm@cr@s#1
226
+ \ttfamily\obeyspaces\obeylines\frenchspacing
227
+ \newcommand{\exmp}[2]{
228
+ \begin{minipage}[t]{\exmpwidinf}\rightskip=0pt plus 1fill\relax##1\medskip\end{minipage}&
229
+ \begin{minipage}[t]{\exmpwidouf}\rightskip=0pt plus 1fill\relax##2\medskip\end{minipage}\\
230
+ \hline
231
+ }
232
+
233
+ \newcommand{\exmpfile}[2]{
234
+ \exmp{
235
+ \verbatiminput{##1}
236
+ }{
237
+ \verbatiminput{##2}
238
+ }%
239
+ }
240
+
241
+ \begin{center}
242
+ \begin{tabular}{|l|l|}
243
+ \hline
244
+ \multicolumn{1}{|c|}{\bf\texttt{\textbf{\InputFileName}}} &
245
+ \multicolumn{1}{|c|}{\bf\texttt{\textbf{\OutputFileName}}} \\
246
+ \hline
247
+ }{
248
+ \end{tabular}
249
+ \end{center}
250
+ }
@@ -0,0 +1,42 @@
1
+ \begin{problem}
2
+ %- if problem.short_name is defined
3
+ [\VAR{problem.short_name}]
4
+ %- endif
5
+ {\VAR{problem.title | escape}}
6
+ {stdin}
7
+ {stdout}
8
+ {\VAR{problem.package.timeLimit / 1000 | round(1, 'floor')} s}
9
+ {\VAR{problem.package.memoryLimit} MB}
10
+
11
+ \VAR{problem.blocks.legend}
12
+
13
+ %- if problem.blocks.input is defined
14
+ \InputFile
15
+ \VAR{problem.blocks.input}
16
+ %- endif
17
+
18
+ %- if problem.blocks.output is defined
19
+ \OutputFile
20
+ \VAR{problem.blocks.output}
21
+ %- endif
22
+
23
+ \Examples
24
+
25
+ %- for sample in problem.samples
26
+ \begin{example}
27
+ \exmpfile{\VAR{sample.inputPath}}{\VAR{sample.outputPath if sample.outputPath is not none else ''}}%
28
+ \end{example}
29
+ %- endfor
30
+
31
+ %- if problem.blocks.notes is defined
32
+ \Notes
33
+ \VAR{problem.blocks.notes}
34
+ %- endif
35
+
36
+ %- if problem.blocks.editorial is defined
37
+ \Editorial
38
+ \VAR{problem.blocks.editorial}
39
+ %- endif
40
+
41
+
42
+ \end{problem}
@@ -0,0 +1,12 @@
1
+ name: "default"
2
+ uri: rsalesc/rbx/rbx/resources/presets/default
3
+ problem: "problem"
4
+ contest: "contest"
5
+ tracking:
6
+ problem:
7
+ - path: statement/template.rbx.tex
8
+ - path: statement/olymp.sty
9
+ contest:
10
+ - path: statement/template.rbx.tex
11
+ - path: statement/olymp.sty
12
+ - path: statement/contest.rbx.tex
@@ -0,0 +1,6 @@
1
+ .box/
2
+ build/
3
+
4
+ *.o
5
+ *.aux
6
+ *.log
@@ -0,0 +1,9 @@
1
+ #include "testlib.h"
2
+
3
+ using namespace std;
4
+
5
+ int main(int argc, char *argv[]) {
6
+ registerGen(argc, argv, 1);
7
+
8
+ println(rnd.next(1, opt<int>(1)), rnd.next(1, opt<int>(1)));
9
+ }
@@ -0,0 +1,44 @@
1
+ # yaml-language-server: $schema=/home/rsalesc/.config/rbx/schemas/Package.json
2
+
3
+ name: 'new-problem'
4
+ timeLimit: 1000
5
+ memoryLimit: 256
6
+ checker: {path: 'wcmp.cpp'} # Download others from testlib with `rbx download checker`
7
+ validator: {path: 'validator.cpp'}
8
+ generators:
9
+ - path: 'gen.cpp'
10
+ name: 'gen'
11
+ testcases:
12
+ - name: 'samples'
13
+ testcaseGlob: 'tests/samples/*.in' # Pattern for the sample inputs.
14
+ - name: 'random'
15
+ generatorScript:
16
+ path: 'random.txt' # Static generator script.
17
+ - name: 'program-random'
18
+ generatorScript:
19
+ path: 'random.py' # Generator script written programatically.
20
+ solutions:
21
+ - path: 'sols/main.cpp'
22
+ outcome: ACCEPTED
23
+ - path: 'sols/wa.cpp'
24
+ outcome: WRONG_ANSWER
25
+ - path: 'sols/slow.cpp'
26
+ outcome: TLE_OR_RTE # Can be TLE too
27
+ statements:
28
+ - title: 'New Problem'
29
+ path: 'statement/statement.rbx.tex' # Open this file to edit your statement.
30
+ type: rbxTeX
31
+ language: 'en'
32
+ assets: ['statement/olymp.sty', 'statement/*.png']
33
+ configure:
34
+ - type: 'rbx-tex' # Convert rbxTeX to TeX
35
+ template: 'statement/template.rbx.tex'
36
+ stresses:
37
+ - name: 'stress'
38
+ generator:
39
+ name: 'gen'
40
+ args: '[1..<MAX_N>] @' # `@` generates a random string
41
+ finder: 'sols/wa.cpp ~ INCORRECT'
42
+ vars:
43
+ "MAX_N": 1000000000 # Can be used in the validator, in stress tests and in the statement.
44
+
@@ -0,0 +1,3 @@
1
+ # Generate 10 random testcases with n <= 1e9
2
+ for i in range(10):
3
+ print(f'gen 1000000000 {i}')
@@ -0,0 +1,2 @@
1
+ gen 123456
2
+ gen 12345678
@@ -0,0 +1,9 @@
1
+ #include <bits/stdc++.h>
2
+
3
+ using namespace std;
4
+
5
+ int32_t main() {
6
+ int32_t a, b;
7
+ cin >> a >> b;
8
+ cout << a + b << endl;
9
+ }
@@ -0,0 +1,15 @@
1
+ #include <bits/stdc++.h>
2
+
3
+ using namespace std;
4
+
5
+ int32_t main() {
6
+ int64_t a, b;
7
+ cin >> a >> b;
8
+
9
+ int64_t i;
10
+ // Unncessarily slow.
11
+ for (int k = 0; k < 10; k++)
12
+ for (i = 0; i < a + b; i++) {}
13
+
14
+ cout << i << endl;
15
+ }
@@ -0,0 +1,9 @@
1
+ #include <bits/stdc++.h>
2
+
3
+ using namespace std;
4
+
5
+ int32_t main() {
6
+ int16_t a, b; // overflow
7
+ cin >> a >> b;
8
+ cout << a + b << endl;
9
+ }