rbx.cp 0.7.0__py3-none-any.whl → 0.9.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.
- rbx/box/cd.py +2 -2
- rbx/box/cli.py +87 -33
- rbx/box/code.py +133 -84
- rbx/box/contest/build_contest_statements.py +2 -2
- rbx/box/contest/contest_package.py +1 -1
- rbx/box/contest/main.py +29 -2
- rbx/box/environment.py +140 -80
- rbx/box/formatting.py +2 -1
- rbx/box/global_package.py +74 -0
- rbx/box/package.py +11 -24
- rbx/box/packaging/__init__.py +0 -0
- rbx/box/packaging/boca/__init__.py +0 -0
- rbx/box/packaging/polygon/packager.py +3 -3
- rbx/box/presets/__init__.py +369 -53
- rbx/box/presets/lock_schema.py +42 -2
- rbx/box/presets/schema.py +4 -0
- rbx/box/remote.py +21 -2
- rbx/box/retries.py +3 -2
- rbx/box/sanitizers/warning_stack.py +5 -5
- rbx/box/solutions.py +37 -25
- rbx/box/statements/build_statements.py +6 -6
- rbx/box/statements/builders.py +1 -1
- rbx/box/stats.py +10 -0
- rbx/box/stresses.py +47 -66
- rbx/box/stressing/finder_parser.py +11 -16
- rbx/box/tasks.py +33 -22
- rbx/box/testcase_utils.py +3 -3
- rbx/box/tooling/boca/scraper.py +1 -1
- rbx/grading/caching.py +98 -47
- rbx/grading/debug_context.py +31 -0
- rbx/grading/grading_context.py +96 -0
- rbx/grading/judge/cacher.py +93 -21
- rbx/grading/judge/sandbox.py +8 -4
- rbx/grading/judge/sandboxes/isolate.py +3 -2
- rbx/grading/judge/sandboxes/stupid_sandbox.py +3 -2
- rbx/grading/judge/sandboxes/timeit.py +1 -1
- rbx/grading/judge/storage.py +170 -35
- rbx/grading/profiling.py +126 -0
- rbx/grading/steps.py +46 -17
- rbx/grading/steps_with_caching.py +52 -26
- rbx/resources/envs/default.rbx.yml +2 -3
- rbx/resources/envs/isolate.rbx.yml +2 -3
- rbx/resources/presets/default/contest/.gitignore +6 -0
- rbx/resources/presets/default/contest/contest.rbx.yml +14 -1
- rbx/resources/presets/default/contest/statement/contest.rbx.tex +24 -86
- rbx/resources/presets/default/contest/statement/instructions.tex +40 -0
- rbx/resources/presets/default/contest/statement/logo.png +0 -0
- rbx/resources/presets/default/env.rbx.yml +67 -0
- rbx/resources/presets/default/preset.rbx.yml +6 -2
- rbx/resources/presets/default/problem/.gitignore +1 -1
- rbx/resources/presets/default/problem/problem.rbx.yml +12 -8
- rbx/resources/presets/default/shared/contest_template.rbx.tex +57 -0
- rbx/resources/presets/default/shared/icpc.sty +322 -0
- rbx/resources/presets/default/shared/problem_template.rbx.tex +57 -0
- rbx/submitors/codeforces.py +3 -2
- rbx/test.py +1 -1
- rbx/utils.py +6 -1
- {rbx_cp-0.7.0.dist-info → rbx_cp-0.9.0.dist-info}/METADATA +4 -1
- {rbx_cp-0.7.0.dist-info → rbx_cp-0.9.0.dist-info}/RECORD +67 -58
- rbx/resources/presets/default/contest/statement/olymp.sty +0 -250
- rbx/resources/presets/default/contest/statement/template.rbx.tex +0 -42
- rbx/resources/presets/default/problem/statement/olymp.sty +0 -250
- rbx/resources/presets/default/problem/statement/template.rbx.tex +0 -89
- /rbx/resources/presets/default/problem/{gen.cpp → gens/gen.cpp} +0 -0
- /rbx/resources/presets/default/problem/{tests → manual_tests}/samples/000.in +0 -0
- /rbx/resources/presets/default/problem/{tests → manual_tests}/samples/001.in +0 -0
- /rbx/resources/presets/default/problem/{random.py → testplan/random.py} +0 -0
- /rbx/resources/presets/default/problem/{random.txt → testplan/random.txt} +0 -0
- {rbx_cp-0.7.0.dist-info → rbx_cp-0.9.0.dist-info}/LICENSE +0 -0
- {rbx_cp-0.7.0.dist-info → rbx_cp-0.9.0.dist-info}/WHEEL +0 -0
- {rbx_cp-0.7.0.dist-info → rbx_cp-0.9.0.dist-info}/entry_points.txt +0 -0
@@ -1,22 +1,22 @@
|
|
1
1
|
---
|
2
2
|
# yaml-language-server: $schema=https://rsalesc.github.io/rbx/schemas/Package.json
|
3
3
|
name: "new-problem"
|
4
|
-
timeLimit: 1000
|
5
|
-
memoryLimit: 256
|
4
|
+
timeLimit: 1000 # ms
|
5
|
+
memoryLimit: 256 # MiB
|
6
6
|
checker: {path: "wcmp.cpp"} # Download others from testlib with `rbx download checker`
|
7
7
|
validator: {path: "validator.cpp"}
|
8
8
|
generators:
|
9
|
-
- path: "gen.cpp"
|
9
|
+
- path: "gens/gen.cpp"
|
10
10
|
name: "gen"
|
11
11
|
testcases:
|
12
12
|
- name: "samples"
|
13
|
-
testcaseGlob: "
|
13
|
+
testcaseGlob: "manual_tests/samples/*.in" # Pattern for the sample inputs.
|
14
14
|
- name: "random"
|
15
15
|
generatorScript:
|
16
|
-
path: "random.txt" # Static generator script.
|
16
|
+
path: "testplan/random.txt" # Static generator script (testplan).
|
17
17
|
- name: "program-random"
|
18
18
|
generatorScript:
|
19
|
-
path: "random.py" # Generator script written programatically.
|
19
|
+
path: "testplan/random.py" # Generator script written programatically.
|
20
20
|
solutions:
|
21
21
|
- path: "sols/main.cpp"
|
22
22
|
outcome: "ACCEPTED"
|
@@ -30,7 +30,9 @@ statements:
|
|
30
30
|
path: "statement/statement.rbx.tex" # Open this file to edit your statement.
|
31
31
|
type: "rbxTeX"
|
32
32
|
language: "en"
|
33
|
-
assets:
|
33
|
+
assets: # Define assets for the statement.
|
34
|
+
- "statement/icpc.sty"
|
35
|
+
- "statement/*.png"
|
34
36
|
configure:
|
35
37
|
- type: "rbx-tex" # Convert rbxTeX to TeX
|
36
38
|
template: "statement/template.rbx.tex"
|
@@ -51,5 +53,7 @@ unitTests:
|
|
51
53
|
outcome: "ACCEPTED"
|
52
54
|
- glob: "unit/checker/wa*"
|
53
55
|
outcome: "WRONG_ANSWER"
|
56
|
+
# Can be used in the validator, checker, interactor, stress tests
|
57
|
+
# and in the statement.
|
54
58
|
vars:
|
55
|
-
MAX_N: 1000000000
|
59
|
+
MAX_N: 1000000000
|
@@ -0,0 +1,57 @@
|
|
1
|
+
\documentclass[a4paper,11pt]{article}
|
2
|
+
|
3
|
+
\def\lang{\VAR{lang}}
|
4
|
+
\usepackage{icpc}
|
5
|
+
|
6
|
+
%- if problem.blocks.preamble is defined
|
7
|
+
\VAR{problem.blocks.preamble}
|
8
|
+
%- endif
|
9
|
+
|
10
|
+
\begin{document}
|
11
|
+
|
12
|
+
\includeProblem
|
13
|
+
%- if problem.short_name is defined
|
14
|
+
[\VAR{problem.short_name}]
|
15
|
+
%- endif
|
16
|
+
{\VAR{problem.title | escape}}{
|
17
|
+
|
18
|
+
\VAR{problem.blocks.legend}
|
19
|
+
|
20
|
+
%- if problem.blocks.input is defined
|
21
|
+
\inputdesc{\VAR{problem.blocks.input}}
|
22
|
+
%- endif
|
23
|
+
|
24
|
+
%- if problem.blocks.output is defined
|
25
|
+
\outputdesc{\VAR{problem.blocks.output}}
|
26
|
+
%- endif
|
27
|
+
|
28
|
+
%- if problem.blocks.interaction is defined
|
29
|
+
\interactiondesc{\VAR{problem.blocks.interaction}}
|
30
|
+
%- endif
|
31
|
+
|
32
|
+
%- if problem.samples
|
33
|
+
\vspace{0.3cm}
|
34
|
+
\subsection*{\strExamples}
|
35
|
+
%- for sample in problem.samples
|
36
|
+
%- if sample.interaction is not none
|
37
|
+
\exampleInteractive
|
38
|
+
%- for entry in sample.interaction.entries
|
39
|
+
\interaction{\VAR{entry.data}}{\VAR{entry.pipe}}
|
40
|
+
%- endfor
|
41
|
+
%- else
|
42
|
+
\example{\VAR{sample.inputPath}}
|
43
|
+
{\VAR{sample.outputPath if sample.outputPath is not none else ''}}
|
44
|
+
%- endif
|
45
|
+
%- if sample.explanation is not none
|
46
|
+
\explanation{\VAR{sample.explanation}}
|
47
|
+
%- endif
|
48
|
+
%- endfor
|
49
|
+
%- endif
|
50
|
+
|
51
|
+
%- if problem.blocks.notes is defined
|
52
|
+
\subsection*{Observações}
|
53
|
+
\VAR{problem.blocks.notes}
|
54
|
+
%- endif
|
55
|
+
}
|
56
|
+
\end{document}
|
57
|
+
|
@@ -0,0 +1,322 @@
|
|
1
|
+
\usepackage{caption}
|
2
|
+
\usepackage{epsfig}
|
3
|
+
\usepackage{moreverb}
|
4
|
+
\usepackage{float}
|
5
|
+
\usepackage{fancyvrb}
|
6
|
+
\usepackage{multicol}
|
7
|
+
\usepackage{hyperref}
|
8
|
+
\usepackage{ifthen}
|
9
|
+
\usepackage{titlesec}
|
10
|
+
\usepackage{pmboxdraw}
|
11
|
+
\usepackage{xcolor}
|
12
|
+
\usepackage{colortbl}
|
13
|
+
\usepackage{tikz}
|
14
|
+
\usepackage{subcaption}
|
15
|
+
\usetikzlibrary{matrix,positioning,fit,scopes,chains}
|
16
|
+
\let\mytitleformat\titleformat
|
17
|
+
\let\titleformat\relax
|
18
|
+
\usepackage{logicpuzzle}
|
19
|
+
\usepackage{enumitem}
|
20
|
+
\usepackage{amsfonts}
|
21
|
+
\usepackage[brazil]{babel}
|
22
|
+
\usepackage[utf8]{inputenc}
|
23
|
+
\usepackage[T1]{fontenc}
|
24
|
+
\usepackage{indentfirst}
|
25
|
+
\usepackage{pdftexcmds}
|
26
|
+
\usepackage{amsmath}
|
27
|
+
|
28
|
+
\captionsetup[figure]{labelformat=empty}
|
29
|
+
\setlist[itemize]{noitemsep, nolistsep}
|
30
|
+
|
31
|
+
\setlength{\marginparwidth}{0pt}
|
32
|
+
\setlength{\oddsidemargin}{-0.25cm}
|
33
|
+
\setlength{\evensidemargin}{-0.25cm}
|
34
|
+
\setlength{\marginparsep}{0pt}
|
35
|
+
|
36
|
+
\setlength{\parindent}{0cm}
|
37
|
+
\setlength{\parskip}{5pt}
|
38
|
+
|
39
|
+
\setlength{\textwidth}{16.5cm}
|
40
|
+
\setlength{\textheight}{25.5cm}
|
41
|
+
|
42
|
+
\setlength{\voffset}{-1in}
|
43
|
+
|
44
|
+
\newcommand{\insereArquivo}[1]{
|
45
|
+
\ifnum0\pdffilesize{#1}>0
|
46
|
+
\VerbatimInput[xleftmargin=0mm,numbers=none,obeytabs=true]{#1}\vspace{.5em}
|
47
|
+
\fi
|
48
|
+
}
|
49
|
+
|
50
|
+
\newcommand{\insereTexto}[1]{
|
51
|
+
\texttt{#1}
|
52
|
+
}
|
53
|
+
|
54
|
+
\def\portuguese{pt}
|
55
|
+
\ifx\lang\portuguese
|
56
|
+
\def\strTaskSheet{Caderno de Problemas}
|
57
|
+
\def\strSolutionSheet{Caderno de Soluções}
|
58
|
+
\def\strSponsored{Patrocínio}
|
59
|
+
\def\strHosted{Realização}
|
60
|
+
\def\strOrganized{Organização}
|
61
|
+
\def\strProblem{Problema }
|
62
|
+
\def\strExplanation{Explicação do exemplo }
|
63
|
+
\def\strInput{Entrada}
|
64
|
+
\def\strOutput{Saída}
|
65
|
+
\def\strInteraction{Interação}
|
66
|
+
\def\strSampleinput{Exemplo de entrada }
|
67
|
+
\def\strSampleoutput{Exemplo de saída }
|
68
|
+
\def\strSampleinteraction{Exemplo de interação }
|
69
|
+
\def\strInteractionread{Leitura}
|
70
|
+
\def\strInteractionwrite{Escrita}
|
71
|
+
\def\strExamples{Exemplos}
|
72
|
+
\def\strSolution{Solução}
|
73
|
+
\def\strNotes{Observações}
|
74
|
+
\else
|
75
|
+
\def\strTaskSheet{Task Sheet}
|
76
|
+
\def\strSolutionSheet{Solution Sheet}
|
77
|
+
\def\strSponsored{Sponsored by}
|
78
|
+
\def\strHosted{Hosted by}
|
79
|
+
\def\strOrganized{Organized by}
|
80
|
+
\def\strProblem{Problem }
|
81
|
+
\def\strExplanation{Explanation of sample }
|
82
|
+
\def\strInput{Input}
|
83
|
+
\def\strOutput{Output}
|
84
|
+
\def\strInteraction{Interaction}
|
85
|
+
\def\strSampleinput{Sample input }
|
86
|
+
\def\strSampleoutput{Sample output }
|
87
|
+
\def\strSampleinteraction{Sample interaction }
|
88
|
+
\def\strInteractionread{Read}
|
89
|
+
\def\strInteractionwrite{Write}
|
90
|
+
\def\strExamples{Examples}
|
91
|
+
\def\strSolution{Solution}
|
92
|
+
\def\strNotes{Notes}
|
93
|
+
\fi
|
94
|
+
|
95
|
+
\newcommand{\includeProblem}[3][]
|
96
|
+
{
|
97
|
+
\newpage
|
98
|
+
\def\ProblemLetter{#1}
|
99
|
+
\ifx\ProblemLetter\empty
|
100
|
+
{\huge{\bf #2}}
|
101
|
+
\else
|
102
|
+
{\huge{\bf \strProblem #1. #2}}
|
103
|
+
\fi
|
104
|
+
#3
|
105
|
+
}
|
106
|
+
|
107
|
+
\newcommand{\inputdesc}[1]{
|
108
|
+
\subsection*{\strInput}
|
109
|
+
{#1} }
|
110
|
+
|
111
|
+
\newcommand{\inputdescline}[1]{
|
112
|
+
\subsection*{\strInput}
|
113
|
+
\strInputdescline {#1} }
|
114
|
+
|
115
|
+
\newcommand{\outputdesc}[1]{
|
116
|
+
\subsection*{\strOutput}
|
117
|
+
{#1}}
|
118
|
+
|
119
|
+
\newcommand{\interactiondesc}[1]{
|
120
|
+
\subsection*{\strInteraction}
|
121
|
+
{#1}}
|
122
|
+
|
123
|
+
\newcommand{\sampledesc}[2]{
|
124
|
+
\subsection*{\strExplanation #1}
|
125
|
+
{#2}}
|
126
|
+
|
127
|
+
|
128
|
+
\newcommand{\incat}[1]{sample-#1.in}
|
129
|
+
\newcommand{\solcat}[1]{sample-#1.sol}
|
130
|
+
\newcounter{problemcounter}
|
131
|
+
\setcounter{problemcounter}{0}
|
132
|
+
\newcounter{exemplocounter}[problemcounter]
|
133
|
+
\setcounter{exemplocounter}{0}
|
134
|
+
|
135
|
+
\newcommand\mc[1]{\multicolumn{1}{l}{#1}}
|
136
|
+
\newcommand{\example}[2]{
|
137
|
+
{\small
|
138
|
+
|
139
|
+
\stepcounter{exemplocounter}
|
140
|
+
|
141
|
+
\begin{minipage}[c]{0.945\textwidth}
|
142
|
+
\begin{center}
|
143
|
+
\begin{tabular}{|l|l|}
|
144
|
+
\mc{\bf{\strSampleinput \arabic{exemplocounter}}}
|
145
|
+
&
|
146
|
+
\mc{\bf{\strSampleoutput \arabic{exemplocounter}}} \\
|
147
|
+
|
148
|
+
\hline
|
149
|
+
\begin{minipage}[t]{0.5\textwidth}
|
150
|
+
\vspace{0.01cm}
|
151
|
+
\insereArquivo{#1}
|
152
|
+
\vspace{-0.2cm}
|
153
|
+
\end{minipage}
|
154
|
+
&
|
155
|
+
\begin{minipage}[t]{0.5\textwidth}
|
156
|
+
\vspace{0.01cm}
|
157
|
+
\insereArquivo{#2}
|
158
|
+
\vspace{-0.2cm}
|
159
|
+
\end{minipage} \\
|
160
|
+
\hline
|
161
|
+
\end{tabular}
|
162
|
+
\end{center}
|
163
|
+
\end{minipage} % leave next line empty
|
164
|
+
|
165
|
+
}
|
166
|
+
} % example
|
167
|
+
|
168
|
+
\newcommand{\exampleInteractive}{
|
169
|
+
{\small
|
170
|
+
|
171
|
+
\stepcounter{exemplocounter}
|
172
|
+
|
173
|
+
\begin{center}
|
174
|
+
\begin{tabular}{lcr}
|
175
|
+
\begin{minipage}[t]{0.3\textwidth}
|
176
|
+
\hspace{-0.19cm}\bf{\strInteractionread}
|
177
|
+
\end{minipage}
|
178
|
+
&
|
179
|
+
\begin{minipage}[t]{0.3\textwidth}
|
180
|
+
\bf{\strSampleinteraction \arabic{exemplocounter}}
|
181
|
+
\end{minipage}
|
182
|
+
&
|
183
|
+
\begin{minipage}[t]{0.3\textwidth}
|
184
|
+
\hfill \bf{\strInteractionwrite}
|
185
|
+
\end{minipage}
|
186
|
+
\end{tabular}
|
187
|
+
\end{center}
|
188
|
+
\vspace{-0.5cm}
|
189
|
+
}
|
190
|
+
} % exampleInteractive
|
191
|
+
|
192
|
+
\newcommand{\interaction}[2]{
|
193
|
+
{\small
|
194
|
+
|
195
|
+
\ifthenelse{\equal{#2}{\string 0}}{
|
196
|
+
\vspace{-0.3cm}
|
197
|
+
\begin{tabular}{|l|}
|
198
|
+
\hline
|
199
|
+
\begin{minipage}[t]{0.55\textwidth}
|
200
|
+
\vspace{0.01cm}
|
201
|
+
\insereTexto{#1}
|
202
|
+
\vspace{0.28cm}
|
203
|
+
\end{minipage}
|
204
|
+
\\
|
205
|
+
\hline
|
206
|
+
\end{tabular}
|
207
|
+
}{
|
208
|
+
\vspace{-0.3cm}
|
209
|
+
\hfill
|
210
|
+
\begin{tabular}{|l|}
|
211
|
+
\hline
|
212
|
+
\begin{minipage}[t]{0.55\textwidth}
|
213
|
+
\vspace{0.01cm}
|
214
|
+
\insereTexto{#1}
|
215
|
+
\vspace{0.28cm}
|
216
|
+
\end{minipage}
|
217
|
+
\\
|
218
|
+
\hline
|
219
|
+
\end{tabular}
|
220
|
+
}
|
221
|
+
|
222
|
+
}
|
223
|
+
} % interaction
|
224
|
+
|
225
|
+
\newcommand{\explanation}[1]{
|
226
|
+
\textbf{\strExplanation\theexemplocounter}
|
227
|
+
|
228
|
+
{#1} % leave empty line
|
229
|
+
|
230
|
+
} % explanation
|
231
|
+
|
232
|
+
\addtolength{\parskip}{0.4\baselineskip}
|
233
|
+
|
234
|
+
\pagestyle{myheadings}
|
235
|
+
|
236
|
+
\newcounter{pcounter}\setcounter{pcounter}{0}
|
237
|
+
\newcounter{qcounter}\setcounter{qcounter}{0}
|
238
|
+
|
239
|
+
\usepackage{titlesec}
|
240
|
+
|
241
|
+
\titlespacing\section{0pt}{6pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
|
242
|
+
\titlespacing\subsection{0pt}{6pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
|
243
|
+
\titlespacing\subsubsection{0pt}{6t plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
|
244
|
+
|
245
|
+
\newcommand{\InsertTitlePage}
|
246
|
+
{
|
247
|
+
\pagestyle{myheadings}
|
248
|
+
\markright{\Title -- \Year}
|
249
|
+
|
250
|
+
%%% Title Page
|
251
|
+
\begin{titlepage}
|
252
|
+
\vspace*{\fill}
|
253
|
+
\begin{center}
|
254
|
+
|
255
|
+
\includegraphics[width=8cm]{logo.png}
|
256
|
+
|
257
|
+
\vspace{0.8cm}
|
258
|
+
{\huge\bf \Title}\\[12pt]
|
259
|
+
{\large{\bf \strTaskSheet}}\\[12pt]
|
260
|
+
\vspace{1.5cm}
|
261
|
+
{\huge{\bf \Year}}
|
262
|
+
|
263
|
+
% \vspace{1cm}
|
264
|
+
% {\small \bf \strSponsored}\\[8pt]
|
265
|
+
|
266
|
+
% \includegraphics[width=16cm]{sponsors.png}
|
267
|
+
|
268
|
+
% \vspace{2cm}
|
269
|
+
% \begin{center}
|
270
|
+
% \setlength{\tabcolsep}{0.1\textwidth}
|
271
|
+
% \begin{tabular}{cc}
|
272
|
+
% {\small\bf \strHosted} & {\small\bf \strOrganized} \\
|
273
|
+
% \includegraphics[width=3cm]{host.png} & \includegraphics[width=4cm]{organizers.png} \\
|
274
|
+
% \end{tabular}
|
275
|
+
% \end{center}
|
276
|
+
|
277
|
+
\end{center}
|
278
|
+
\vspace*{\fill}
|
279
|
+
\end{titlepage}
|
280
|
+
|
281
|
+
\clearpage
|
282
|
+
}
|
283
|
+
|
284
|
+
\newcommand{\InsertEditorialTitlePage}
|
285
|
+
{
|
286
|
+
\pagestyle{myheadings}
|
287
|
+
\markright{\Title -- \Year}
|
288
|
+
|
289
|
+
%%% Title Page
|
290
|
+
\begin{titlepage}
|
291
|
+
\vspace*{\fill}
|
292
|
+
\begin{center}
|
293
|
+
|
294
|
+
\includegraphics[width=8cm]{logo.png}
|
295
|
+
|
296
|
+
\vspace{0.8cm}
|
297
|
+
{\huge\bf \Title}\\[12pt]
|
298
|
+
{\large{\bf \strSolutionSheet}}\\[12pt]
|
299
|
+
\vspace{1.5cm}
|
300
|
+
{\huge{\bf \Year}}
|
301
|
+
|
302
|
+
% \vspace{1cm}
|
303
|
+
% {\small \bf \strSponsored}\\[8pt]
|
304
|
+
|
305
|
+
% \includegraphics[width=16cm]{sponsors.png}
|
306
|
+
|
307
|
+
% \vspace{2cm}
|
308
|
+
% \begin{center}
|
309
|
+
% \setlength{\tabcolsep}{0.1\textwidth}
|
310
|
+
% \begin{tabular}{cc}
|
311
|
+
% {\small\bf \strHosted} & {\small\bf \strOrganized} \\
|
312
|
+
% \includegraphics[width=3cm]{host.png} & \includegraphics[width=4cm]{organizers.png} \\
|
313
|
+
% \end{tabular}
|
314
|
+
% \end{center}
|
315
|
+
|
316
|
+
\end{center}
|
317
|
+
\vspace*{\fill}
|
318
|
+
\end{titlepage}
|
319
|
+
|
320
|
+
\clearpage
|
321
|
+
}
|
322
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
\documentclass[a4paper,11pt]{article}
|
2
|
+
|
3
|
+
\def\lang{\VAR{lang}}
|
4
|
+
\usepackage{icpc}
|
5
|
+
|
6
|
+
%- if problem.blocks.preamble is defined
|
7
|
+
\VAR{problem.blocks.preamble}
|
8
|
+
%- endif
|
9
|
+
|
10
|
+
\begin{document}
|
11
|
+
|
12
|
+
\includeProblem
|
13
|
+
%- if problem.short_name is defined
|
14
|
+
[\VAR{problem.short_name}]
|
15
|
+
%- endif
|
16
|
+
{\VAR{problem.title | escape}}{
|
17
|
+
|
18
|
+
\VAR{problem.blocks.legend}
|
19
|
+
|
20
|
+
%- if problem.blocks.input is defined
|
21
|
+
\inputdesc{\VAR{problem.blocks.input}}
|
22
|
+
%- endif
|
23
|
+
|
24
|
+
%- if problem.blocks.output is defined
|
25
|
+
\outputdesc{\VAR{problem.blocks.output}}
|
26
|
+
%- endif
|
27
|
+
|
28
|
+
%- if problem.blocks.interaction is defined
|
29
|
+
\interactiondesc{\VAR{problem.blocks.interaction}}
|
30
|
+
%- endif
|
31
|
+
|
32
|
+
%- if problem.samples
|
33
|
+
\vspace{0.3cm}
|
34
|
+
\subsection*{\strExamples}
|
35
|
+
%- for sample in problem.samples
|
36
|
+
%- if sample.interaction is not none
|
37
|
+
\exampleInteractive
|
38
|
+
%- for entry in sample.interaction.entries
|
39
|
+
\interaction{\VAR{entry.data}}{\VAR{entry.pipe}}
|
40
|
+
%- endfor
|
41
|
+
%- else
|
42
|
+
\example{\VAR{sample.inputPath}}
|
43
|
+
{\VAR{sample.outputPath if sample.outputPath is not none else ''}}
|
44
|
+
%- endif
|
45
|
+
%- if sample.explanation is not none
|
46
|
+
\explanation{\VAR{sample.explanation}}
|
47
|
+
%- endif
|
48
|
+
%- endfor
|
49
|
+
%- endif
|
50
|
+
|
51
|
+
%- if problem.blocks.notes is defined
|
52
|
+
\subsection*{Observações}
|
53
|
+
\VAR{problem.blocks.notes}
|
54
|
+
%- endif
|
55
|
+
}
|
56
|
+
\end{document}
|
57
|
+
|
rbx/submitors/codeforces.py
CHANGED
@@ -3,6 +3,7 @@ from typing import Any
|
|
3
3
|
|
4
4
|
import mechanize
|
5
5
|
|
6
|
+
from rbx import utils
|
6
7
|
from rbx.console import console
|
7
8
|
from rbx.schema import Problem
|
8
9
|
from rbx.submitors.submitor import Submitor
|
@@ -55,7 +56,7 @@ class Session:
|
|
55
56
|
)
|
56
57
|
|
57
58
|
def submit_from_contest(self, url: str, file: pathlib.Path, typeid: int):
|
58
|
-
filename = str(
|
59
|
+
filename = str(utils.abspath(file))
|
59
60
|
self.br.open(url)
|
60
61
|
form = self.select_form_by_class('submit-form', self.br.forms())
|
61
62
|
if form is None:
|
@@ -67,7 +68,7 @@ class Session:
|
|
67
68
|
self.br.submit()
|
68
69
|
|
69
70
|
def submit(self, url: str, file: pathlib.Path, typeid: int):
|
70
|
-
filename = str(
|
71
|
+
filename = str(utils.abspath(file))
|
71
72
|
response = self.br.open(url)
|
72
73
|
if response is None:
|
73
74
|
raise Exception('Response was not received')
|
rbx/test.py
CHANGED
@@ -159,7 +159,7 @@ def _pretty_print_outcome_panel(
|
|
159
159
|
) -> Panel:
|
160
160
|
result: steps.CheckerResult = eval.result
|
161
161
|
is_tle = result.outcome.is_slow() or (
|
162
|
-
problem.timeLimit and eval.log.time * 1000 > problem.timeLimit
|
162
|
+
problem.timeLimit and (eval.log.time or 0) * 1000 > problem.timeLimit
|
163
163
|
)
|
164
164
|
|
165
165
|
text = Text()
|
rbx/utils.py
CHANGED
@@ -3,6 +3,7 @@ import fcntl
|
|
3
3
|
import functools
|
4
4
|
import json
|
5
5
|
import os
|
6
|
+
import os.path
|
6
7
|
import pathlib
|
7
8
|
import resource
|
8
9
|
from typing import Any, Optional, Type, TypeVar
|
@@ -34,6 +35,10 @@ def highlight_str(s: str) -> text.Text:
|
|
34
35
|
return txt
|
35
36
|
|
36
37
|
|
38
|
+
def abspath(path: pathlib.Path) -> pathlib.Path:
|
39
|
+
return pathlib.Path(os.path.abspath(path))
|
40
|
+
|
41
|
+
|
37
42
|
def highlight_json_obj(obj: Any) -> text.Text:
|
38
43
|
js = json.dumps(obj)
|
39
44
|
return highlight_str(js)
|
@@ -70,7 +75,7 @@ def dump_schema(model: Type[BaseModel], path: pathlib.Path):
|
|
70
75
|
def ensure_schema(model: Type[BaseModel]) -> pathlib.Path:
|
71
76
|
path = get_app_path() / 'schemas' / f'{model.__name__}.json'
|
72
77
|
dump_schema(model, path)
|
73
|
-
return path
|
78
|
+
return abspath(path)
|
74
79
|
|
75
80
|
|
76
81
|
def model_json(model: BaseModel) -> str:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: rbx.cp
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.9.0
|
4
4
|
Summary:
|
5
5
|
Author: Roberto Sales
|
6
6
|
Requires-Python: >=3.9.1,<4.0.0
|
@@ -18,13 +18,16 @@ Requires-Dist: dateparser (>=1.2.1,<2.0.0)
|
|
18
18
|
Requires-Dist: deepmerge (>=2.0,<3.0)
|
19
19
|
Requires-Dist: fastapi (>=0.115.8,<0.116.0)
|
20
20
|
Requires-Dist: filelock (>=3.14.0,<4.0.0)
|
21
|
+
Requires-Dist: gitignore-parser (>=0.1.12,<0.2.0)
|
21
22
|
Requires-Dist: gitpython (>=3.1.43,<4.0.0)
|
22
23
|
Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
|
23
24
|
Requires-Dist: lark (>=1.2.2,<2.0.0)
|
24
25
|
Requires-Dist: latexbuild (>=0.2.2,<0.3.0)
|
26
|
+
Requires-Dist: lz4 (>=4.4.4,<5.0.0)
|
25
27
|
Requires-Dist: mechanize (>=0.4.10,<0.5.0)
|
26
28
|
Requires-Dist: more-itertools (>=10.5.0,<11.0.0)
|
27
29
|
Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
|
30
|
+
Requires-Dist: ordered-set (>=4.1.0,<5.0.0)
|
28
31
|
Requires-Dist: psutil (>=7.0.0,<8.0.0)
|
29
32
|
Requires-Dist: pydantic (==2.8.2)
|
30
33
|
Requires-Dist: pydantic-xml[lxml] (>=2.11.0,<3.0.0)
|