@jpetit/toolkit 3.0.0
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.
- package/.prettierignore +11 -0
- package/.prettierrc.json +9 -0
- package/.vscode/settings.json +26 -0
- package/README.md +22 -0
- package/assets/lua/fixCodeBlocks.lua +19 -0
- package/assets/lua/removeEnvs.lua +20 -0
- package/assets/lua/removeHtmlOnly.lua +11 -0
- package/assets/problems/graphics/japanese-flag.pbm/README.md +14 -0
- package/assets/problems/graphics/japanese-flag.pbm/award.png +0 -0
- package/assets/problems/graphics/japanese-flag.pbm/handler.yml +2 -0
- package/assets/problems/graphics/japanese-flag.pbm/problem.ca.tex +21 -0
- package/assets/problems/graphics/japanese-flag.pbm/problem.ca.yml +3 -0
- package/assets/problems/graphics/japanese-flag.pbm/sample-1.inp +1 -0
- package/assets/problems/graphics/japanese-flag.pbm/sample-2.inp +1 -0
- package/assets/problems/graphics/japanese-flag.pbm/solution.cc +25 -0
- package/assets/problems/graphics/japanese-flag.pbm/solution.py +11 -0
- package/assets/problems/graphics/tortuga.pbm/README.md +13 -0
- package/assets/problems/graphics/tortuga.pbm/award.png +0 -0
- package/assets/problems/graphics/tortuga.pbm/handler.yml +2 -0
- package/assets/problems/graphics/tortuga.pbm/problem.ca.tex +23 -0
- package/assets/problems/graphics/tortuga.pbm/problem.ca.yml +3 -0
- package/assets/problems/graphics/tortuga.pbm/sample.inp +0 -0
- package/assets/problems/graphics/tortuga.pbm/solution.py +11 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/README.md +15 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/award.html +1 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/award.png +0 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/campanar.eps +1113 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/campanar.png +0 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/generate.cc +10 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/handler.yml +2 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/problem.ca.tex +59 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/problem.ca.yml +3 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/problem.en.tex +52 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/problem.en.yml +4 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/sample.inp +7 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/slow.cc +29 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/solution.cc +48 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/test-1.inp +12 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/test-2.inp +100000 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/test-2.ops +1 -0
- package/assets/problems/standard/campanar-de-la-torrassa.pbm/test-b.inp +0 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/README.md +11 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/handler.yml +1 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/problem.ca.tex +17 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/problem.ca.yml +3 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/problem.en.tex +16 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/problem.en.yml +4 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/sample-1.inp +1 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/sample-2.inp +1 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/sample-3.inp +1 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/solution.c +18 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/solution.cc +13 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/solution.java +16 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/solution.py +5 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/test-1.inp +1 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/test-2.inp +1 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/test-3.inp +1 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/test-4.inp +1 -0
- package/assets/problems/standard/maximum-of-2-integers.pbm/test-5.inp +1 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/README.md +12 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/atzar.cc +85 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/award.png +0 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/generate-1.cc +26 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/generate-2.cc +26 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/generate-3.cc +26 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/generate-4.cc +26 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/handler.yml +1 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/problem.ca.tex +40 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/problem.ca.yml +3 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/problem.en.tex +40 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/problem.en.yml +4 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/random-1.inp +24 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/random-2.inp +27 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/random-3.inp +38 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/random-4.inp +50 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/sample-1.inp +9 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/sample-2.inp +6 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/sample-3.inp +7 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/solution.cc +38 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-1.inp +5 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-2.inp +6 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-3.inp +6 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-4.inp +9 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-5.inp +10 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-6.inp +9 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-7.inp +12 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-8.inp +3 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-9.inp +37 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-91.inp +52 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-92.inp +25 -0
- package/assets/problems/standard/treasures-in-a-map.pbm/test-93.inp +3 -0
- package/assets/sty/judgeit.ca.sty +54 -0
- package/assets/sty/judgeit.de.sty +61 -0
- package/assets/sty/judgeit.en.sty +60 -0
- package/assets/sty/judgeit.es.sty +54 -0
- package/assets/sty/judgeit.fr.sty +59 -0
- package/assets/sty/judgeit.sty +307 -0
- package/assets/sty/picins.sty +579 -0
- package/assets.zip +0 -0
- package/eslint.config.mjs +31 -0
- package/lib/ai.ts +138 -0
- package/lib/assets.ts +31 -0
- package/lib/cleaner.ts +58 -0
- package/lib/compilers/_frompython.ts +388 -0
- package/lib/compilers/base.ts +97 -0
- package/lib/compilers/gcc.ts +47 -0
- package/lib/compilers/gxx.ts +47 -0
- package/lib/compilers/index.ts +61 -0
- package/lib/compilers/python3.ts +67 -0
- package/lib/data.ts +19 -0
- package/lib/doctor.ts +104 -0
- package/lib/generate.ts +333 -0
- package/lib/maker.ts +535 -0
- package/lib/settings.ts +42 -0
- package/lib/tui.ts +69 -0
- package/lib/utils.ts +83 -0
- package/package.json +56 -0
- package/problems/graphic.pbm/README.md +14 -0
- package/problems/graphic.pbm/award.png +0 -0
- package/problems/graphic.pbm/handler.yml +2 -0
- package/problems/graphic.pbm/problem.ca.html +13 -0
- package/problems/graphic.pbm/problem.ca.md +20 -0
- package/problems/graphic.pbm/problem.ca.tex +21 -0
- package/problems/graphic.pbm/problem.ca.txt +20 -0
- package/problems/graphic.pbm/problem.ca.yml +3 -0
- package/problems/graphic.pbm/sample-1.inp +1 -0
- package/problems/graphic.pbm/sample-2.inp +1 -0
- package/problems/graphic.pbm/solution.py +11 -0
- package/problems/maxim2.pbm/Main.java +13 -0
- package/problems/maxim2.pbm/distillation.yml +7 -0
- package/problems/maxim2.pbm/distilled-01.inp +1 -0
- package/problems/maxim2.pbm/distilled-02.inp +1 -0
- package/problems/maxim2.pbm/distilled-03.inp +1 -0
- package/problems/maxim2.pbm/distiller.yml +2 -0
- package/problems/maxim2.pbm/generate-inputs.py +9 -0
- package/problems/maxim2.pbm/handler.yml +2 -0
- package/problems/maxim2.pbm/ma-1.inp +1 -0
- package/problems/maxim2.pbm/ma-2.inp +1 -0
- package/problems/maxim2.pbm/ma-3.inp +1 -0
- package/problems/maxim2.pbm/ma-4.inp +1 -0
- package/problems/maxim2.pbm/ma-5.inp +1 -0
- package/problems/maxim2.pbm/per-doubles.inp +1 -0
- package/problems/maxim2.pbm/problem.ca.html +11 -0
- package/problems/maxim2.pbm/problem.ca.md +19 -0
- package/problems/maxim2.pbm/problem.ca.tex +17 -0
- package/problems/maxim2.pbm/problem.ca.txt +19 -0
- package/problems/maxim2.pbm/problem.ca.yml +3 -0
- package/problems/maxim2.pbm/problem.en.html +11 -0
- package/problems/maxim2.pbm/problem.en.md +19 -0
- package/problems/maxim2.pbm/problem.en.tex +16 -0
- package/problems/maxim2.pbm/problem.en.txt +19 -0
- package/problems/maxim2.pbm/problem.en.yml +4 -0
- package/problems/maxim2.pbm/sample-1.inp +1 -0
- package/problems/maxim2.pbm/sample-2.inp +1 -0
- package/problems/maxim2.pbm/sample-3.inp +1 -0
- package/problems/maxim2.pbm/solution.c +12 -0
- package/problems/maxim2.pbm/solution.cc +13 -0
- package/problems/maxim2.pbm/solution.java +13 -0
- package/problems/maxim2.pbm/solution.pas +9 -0
- package/problems/maxim2.pbm/solution.py +5 -0
- package/problems/maxim2.pbm/tags.yml +2 -0
- package/problems/maxim2.pbm/test_-1_-1.inp +1 -0
- package/problems/maxim2.pbm/test_-1_-2.inp +1 -0
- package/problems/maxim2.pbm/test_-1_0.inp +1 -0
- package/problems/maxim2.pbm/test_-1_1.inp +1 -0
- package/problems/maxim2.pbm/test_-2_-1.inp +1 -0
- package/problems/maxim2.pbm/test_-2_-2.inp +1 -0
- package/problems/maxim2.pbm/test_-2_0.inp +1 -0
- package/problems/maxim2.pbm/test_-2_1.inp +1 -0
- package/problems/maxim2.pbm/test_0_-1.inp +1 -0
- package/problems/maxim2.pbm/test_0_-2.inp +1 -0
- package/problems/maxim2.pbm/test_0_0.inp +1 -0
- package/problems/maxim2.pbm/test_0_1.inp +1 -0
- package/problems/maxim2.pbm/test_1_-1.inp +1 -0
- package/problems/maxim2.pbm/test_1_-2.inp +1 -0
- package/problems/maxim2.pbm/test_1_0.inp +1 -0
- package/problems/maxim2.pbm/test_1_1.inp +1 -0
- package/test.ts +3 -0
- package/toolkit/ai.ts +30 -0
- package/toolkit/clean.ts +19 -0
- package/toolkit/compilers.ts +29 -0
- package/toolkit/create-jutge-ai.ts +101 -0
- package/toolkit/create-template.ts +51 -0
- package/toolkit/create-wizard.ts +4 -0
- package/toolkit/create.ts +75 -0
- package/toolkit/doctor.ts +17 -0
- package/toolkit/index.ts +28 -0
- package/toolkit/init.ts +66 -0
- package/toolkit/make.ts +60 -0
- package/toolkit/verify.ts +19 -0
- package/tsconfig.json +38 -0
- package/types/zip.d.ts +4 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
\Problem{El campanar de la Torrassa}
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
\Statement
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
\FigureR{width=5cm}{tower-bell}
|
|
8
|
+
\emph{El Campanar de la Torrassa} és un campanar que es troba al barri de
|
|
9
|
+
Collblanc-La Torrassa de L'Hospitalet de Llobregat. Aquest campanar és ben
|
|
10
|
+
conegut per molestar continuament a tots els seus veïns amb les seves
|
|
11
|
+
campanades.
|
|
12
|
+
Dia i nit, les campanes sonen cada quart d'hora de la forma
|
|
13
|
+
tradicional: Suposeu que són les set de la tarda. En aquest
|
|
14
|
+
cas, a les 19:00 les campanes agudes toquen quatre cops i les campanes
|
|
15
|
+
greus toquen 7 cops. Després, a un quart de vuit (19:15),
|
|
16
|
+
les campanes agudes toquen un cop. Més tard, a dos quarts de vuit
|
|
17
|
+
(19:30) les campanes agudes toquen dos cops. Finalment,
|
|
18
|
+
a tres quart de vuit (19:45), les campanes agudes toquen tres cops.
|
|
19
|
+
A més a més, cada dia al migdia les campanes greus toquen 100 cops enlloc
|
|
20
|
+
de 12 per tal de senyalar l'\emph{Àngelus}. Les campanes sempre
|
|
21
|
+
acaben de tocar en menys d'un minut.
|
|
22
|
+
|
|
23
|
+
\medskip
|
|
24
|
+
|
|
25
|
+
(De fet, aquesta situació és una simplificació, perquè en diumenges
|
|
26
|
+
i festes assenyalades, hi ha campanades extra per les misses
|
|
27
|
+
especials, sense parlar del quinze d'agost, quan les campanes toquen durant
|
|
28
|
+
tot el dia.)
|
|
29
|
+
|
|
30
|
+
\medskip
|
|
31
|
+
|
|
32
|
+
Una ONG que lluita contra la pol·lució acústica a les ciutats
|
|
33
|
+
vol comptar el nombre de cops que les campanes d'aquest campanar
|
|
34
|
+
sonen en un gran interval de temps. Concretament, necessiten un
|
|
35
|
+
programa que, donada una hora d'inici i una llargada de temps,
|
|
36
|
+
calculi el nombre de campanades que sonen en aquest periode de temps.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
\Input
|
|
40
|
+
|
|
41
|
+
L'entrada conté diferents jocs de proves, un per línia. Cada joc de proves
|
|
42
|
+
consisteix en tres enters: $h$ i $m$ codefiquen l'hora d'inici ($h$:$m$) i
|
|
43
|
+
satisfàn $0\le h\le 23$ i $0\le m\le 59$; $t$ codefica la llargada de temps
|
|
44
|
+
(en minuts) del temps que es vol mesurar i satisfà $0\le t\le2^{28}$.
|
|
45
|
+
|
|
46
|
+
\Output
|
|
47
|
+
|
|
48
|
+
Per a cada joc de proves, cal escriure en una línia un enter corresponent
|
|
49
|
+
al nombre de cops que les campanades toquen començant a l'hora $h$:$m$
|
|
50
|
+
i durant un periode de $t$
|
|
51
|
+
minuts.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
\Sample
|
|
55
|
+
|
|
56
|
+
\Observation
|
|
57
|
+
|
|
58
|
+
Aquest problema va aparèixer a les semifinals del 2n Concurs de Programació de
|
|
59
|
+
la UPC.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
\Problem{El campanar de la Torrassa}
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
\Statement
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
\FigureR{width=5cm}{bell-tower}
|
|
8
|
+
\emph{El Campanar de la Torrassa} (see picture) is the bell tower of a church
|
|
9
|
+
located in the district of La Torrassa in the city of L'Hospitalet de
|
|
10
|
+
Llobregat. This bell tower is well known for continuously annoying its
|
|
11
|
+
neighbors with the sound of its bells.
|
|
12
|
+
|
|
13
|
+
Day or night, the bells sound every quarter in the traditional way: Suppose it
|
|
14
|
+
is seven in the afternoon (19:00). In this case, at 19:00 the treble bells
|
|
15
|
+
sound 4 times and the bass bells sound 7 times. Then, at 19:15 the treble
|
|
16
|
+
bells sound once. Latter, at 19:30 the treble bells sound twice. Finally, at
|
|
17
|
+
19:45 the treble bells sound three times. Additionally, each day at noon the
|
|
18
|
+
bass bells sound 100 times rather than 12 to signal the \emph{Angelus}. The
|
|
19
|
+
bells always finish playing within the first minute (that is, at 19:01, 19:16,
|
|
20
|
+
19:31, 19:46, etc.).
|
|
21
|
+
|
|
22
|
+
\medskip
|
|
23
|
+
|
|
24
|
+
(This is a simplification, because on Saturdays, Sunday and important dates
|
|
25
|
+
extra bells are played to signal special masses, not to count the 15th of
|
|
26
|
+
August, when they play all day long.)
|
|
27
|
+
|
|
28
|
+
\medskip
|
|
29
|
+
|
|
30
|
+
A non governmental organization that fights acoustic pollution wants to count
|
|
31
|
+
the number of times that the bells of the bell tower sound in a large amount of
|
|
32
|
+
time. Specifically, they need a program, that given a starting time and a
|
|
33
|
+
length, computes the number of times the bells sound in this period of time.
|
|
34
|
+
|
|
35
|
+
\Input
|
|
36
|
+
|
|
37
|
+
Input is made of several test cases, each one on a line. Each test case
|
|
38
|
+
consists of three integer numbers:
|
|
39
|
+
$h$ and $m$ encode the starting
|
|
40
|
+
time ($h$:$m$) and satisfy $0\le h\le 23$ and $0\le m\le 59$;
|
|
41
|
+
$\ell$ encodes the length, in
|
|
42
|
+
minutes, of the time we want to measure and satisfies $0\le\ell\le2^{28}$.
|
|
43
|
+
|
|
44
|
+
\Output
|
|
45
|
+
|
|
46
|
+
For each test case, output must include a line with an integer denoting the
|
|
47
|
+
number of times that the bells sound starting at $h$:$m$ for a length of $\ell$
|
|
48
|
+
minutes.Sample
|
|
49
|
+
|
|
50
|
+
\Observation
|
|
51
|
+
|
|
52
|
+
This problem is from the 2nd UPC Programming Competition.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#include <iostream>
|
|
2
|
+
|
|
3
|
+
using namespace std;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
int main () {
|
|
8
|
+
int h,m,l;
|
|
9
|
+
while (cin >> h >> m >> l) {
|
|
10
|
+
|
|
11
|
+
int c = 0;
|
|
12
|
+
while (l--) {
|
|
13
|
+
if (m==0) {
|
|
14
|
+
c += 4;
|
|
15
|
+
if (h==12) c += 100;
|
|
16
|
+
else if (h==0) c += 12;
|
|
17
|
+
else if (h<12) c += h;
|
|
18
|
+
else c += h - 12;
|
|
19
|
+
} else if (m==15) c += 1;
|
|
20
|
+
else if (m==30) c += 2;
|
|
21
|
+
else if (m==45) c += 3;
|
|
22
|
+
if (++m==60) {
|
|
23
|
+
m = 0;
|
|
24
|
+
if (++h==24) {
|
|
25
|
+
h = 0;
|
|
26
|
+
} } }
|
|
27
|
+
|
|
28
|
+
cout << c << endl;
|
|
29
|
+
} }
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
// 484 és el nombre de campanades desde les 0:0 fins a les 23:59.
|
|
3
|
+
// 1440 és 24*60.
|
|
4
|
+
|
|
5
|
+
#include <iostream>
|
|
6
|
+
using namespace std;
|
|
7
|
+
|
|
8
|
+
int main()
|
|
9
|
+
{
|
|
10
|
+
int h, m, l;
|
|
11
|
+
while (cin >> h >> m >> l)
|
|
12
|
+
{
|
|
13
|
+
|
|
14
|
+
int c = 0;
|
|
15
|
+
while (l--)
|
|
16
|
+
{
|
|
17
|
+
if (m == 0)
|
|
18
|
+
{
|
|
19
|
+
c += 4;
|
|
20
|
+
if (h == 12)
|
|
21
|
+
c += 100;
|
|
22
|
+
else if (h == 0)
|
|
23
|
+
c += 12;
|
|
24
|
+
else if (h < 12)
|
|
25
|
+
c += h;
|
|
26
|
+
else
|
|
27
|
+
c += h - 12;
|
|
28
|
+
}
|
|
29
|
+
else if (m == 15)
|
|
30
|
+
c += 1;
|
|
31
|
+
else if (m == 30)
|
|
32
|
+
c += 2;
|
|
33
|
+
else if (m == 45)
|
|
34
|
+
c += 3;
|
|
35
|
+
if (++m == 60)
|
|
36
|
+
{
|
|
37
|
+
m = 0;
|
|
38
|
+
if (++h == 24)
|
|
39
|
+
{
|
|
40
|
+
h = 0;
|
|
41
|
+
c += 484 * (l / 1440);
|
|
42
|
+
l = l % 1440;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
cout << c << endl;
|
|
47
|
+
}
|
|
48
|
+
}
|