@jutge.org/toolkit 4.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.
Files changed (140) hide show
  1. package/README.md +5 -0
  2. package/assets/images/jutge-toolkit.png +0 -0
  3. package/assets/images/jutge.png +0 -0
  4. package/assets/lua/fixCodeBlocks.lua +19 -0
  5. package/assets/lua/removeEnvs.lua +20 -0
  6. package/assets/lua/removeHtmlOnly.lua +11 -0
  7. package/assets/problems/function/valid-date.pbm/README.md +11 -0
  8. package/assets/problems/function/valid-date.pbm/award.html +1 -0
  9. package/assets/problems/function/valid-date.pbm/award.png +0 -0
  10. package/assets/problems/function/valid-date.pbm/ca/handler.yml +3 -0
  11. package/assets/problems/function/valid-date.pbm/ca/main.c +13 -0
  12. package/assets/problems/function/valid-date.pbm/ca/main.cc +14 -0
  13. package/assets/problems/function/valid-date.pbm/ca/main.java +16 -0
  14. package/assets/problems/function/valid-date.pbm/ca/main.py +6 -0
  15. package/assets/problems/function/valid-date.pbm/ca/problem.ca.tex +40 -0
  16. package/assets/problems/function/valid-date.pbm/ca/problem.ca.yml +3 -0
  17. package/assets/problems/function/valid-date.pbm/ca/random.inp +113976 -0
  18. package/assets/problems/function/valid-date.pbm/ca/sample.inp +4 -0
  19. package/assets/problems/function/valid-date.pbm/ca/solution.c +15 -0
  20. package/assets/problems/function/valid-date.pbm/ca/solution.cc +16 -0
  21. package/assets/problems/function/valid-date.pbm/ca/solution.java +17 -0
  22. package/assets/problems/function/valid-date.pbm/ca/solution.py +13 -0
  23. package/assets/problems/function/valid-date.pbm/en/handler.yml +3 -0
  24. package/assets/problems/function/valid-date.pbm/en/main.c +13 -0
  25. package/assets/problems/function/valid-date.pbm/en/main.cc +14 -0
  26. package/assets/problems/function/valid-date.pbm/en/main.java +16 -0
  27. package/assets/problems/function/valid-date.pbm/en/main.py +7 -0
  28. package/assets/problems/function/valid-date.pbm/en/problem.en.tex +46 -0
  29. package/assets/problems/function/valid-date.pbm/en/problem.en.yml +4 -0
  30. package/assets/problems/function/valid-date.pbm/en/random.inp +108200 -0
  31. package/assets/problems/function/valid-date.pbm/en/sample.inp +4 -0
  32. package/assets/problems/function/valid-date.pbm/en/solution.c +15 -0
  33. package/assets/problems/function/valid-date.pbm/en/solution.cc +16 -0
  34. package/assets/problems/function/valid-date.pbm/en/solution.java +20 -0
  35. package/assets/problems/function/valid-date.pbm/en/solution.py +13 -0
  36. package/assets/problems/graphic/japanese-flag.pbm/README.md +14 -0
  37. package/assets/problems/graphic/japanese-flag.pbm/award.png +0 -0
  38. package/assets/problems/graphic/japanese-flag.pbm/handler.yml +2 -0
  39. package/assets/problems/graphic/japanese-flag.pbm/problem.ca.tex +21 -0
  40. package/assets/problems/graphic/japanese-flag.pbm/problem.ca.yml +3 -0
  41. package/assets/problems/graphic/japanese-flag.pbm/sample-1.inp +1 -0
  42. package/assets/problems/graphic/japanese-flag.pbm/sample-2.inp +1 -0
  43. package/assets/problems/graphic/japanese-flag.pbm/solution.cc +25 -0
  44. package/assets/problems/graphic/japanese-flag.pbm/solution.py +11 -0
  45. package/assets/problems/graphic/tortuga.pbm/README.md +13 -0
  46. package/assets/problems/graphic/tortuga.pbm/award.png +0 -0
  47. package/assets/problems/graphic/tortuga.pbm/handler.yml +2 -0
  48. package/assets/problems/graphic/tortuga.pbm/problem.ca.tex +23 -0
  49. package/assets/problems/graphic/tortuga.pbm/problem.ca.yml +3 -0
  50. package/assets/problems/graphic/tortuga.pbm/sample.inp +0 -0
  51. package/assets/problems/graphic/tortuga.pbm/solution.py +11 -0
  52. package/assets/problems/standard/campanar-de-la-torrassa.pbm/README.md +15 -0
  53. package/assets/problems/standard/campanar-de-la-torrassa.pbm/award.html +1 -0
  54. package/assets/problems/standard/campanar-de-la-torrassa.pbm/award.png +0 -0
  55. package/assets/problems/standard/campanar-de-la-torrassa.pbm/campanar.png +0 -0
  56. package/assets/problems/standard/campanar-de-la-torrassa.pbm/handler.yml +2 -0
  57. package/assets/problems/standard/campanar-de-la-torrassa.pbm/problem.ca.tex +59 -0
  58. package/assets/problems/standard/campanar-de-la-torrassa.pbm/problem.ca.yml +3 -0
  59. package/assets/problems/standard/campanar-de-la-torrassa.pbm/problem.en.tex +52 -0
  60. package/assets/problems/standard/campanar-de-la-torrassa.pbm/problem.en.yml +4 -0
  61. package/assets/problems/standard/campanar-de-la-torrassa.pbm/sample.inp +7 -0
  62. package/assets/problems/standard/campanar-de-la-torrassa.pbm/slow.cc +29 -0
  63. package/assets/problems/standard/campanar-de-la-torrassa.pbm/solution.cc +48 -0
  64. package/assets/problems/standard/campanar-de-la-torrassa.pbm/test-1.inp +12 -0
  65. package/assets/problems/standard/campanar-de-la-torrassa.pbm/test-2.inp +100000 -0
  66. package/assets/problems/standard/campanar-de-la-torrassa.pbm/test-2.ops +1 -0
  67. package/assets/problems/standard/campanar-de-la-torrassa.pbm/test-b.inp +0 -0
  68. package/assets/problems/standard/maximum-of-2-integers.pbm/README.md +11 -0
  69. package/assets/problems/standard/maximum-of-2-integers.pbm/handler.yml +1 -0
  70. package/assets/problems/standard/maximum-of-2-integers.pbm/problem.ca.tex +17 -0
  71. package/assets/problems/standard/maximum-of-2-integers.pbm/problem.ca.yml +3 -0
  72. package/assets/problems/standard/maximum-of-2-integers.pbm/problem.en.tex +16 -0
  73. package/assets/problems/standard/maximum-of-2-integers.pbm/problem.en.yml +4 -0
  74. package/assets/problems/standard/maximum-of-2-integers.pbm/sample-1.inp +1 -0
  75. package/assets/problems/standard/maximum-of-2-integers.pbm/sample-2.inp +1 -0
  76. package/assets/problems/standard/maximum-of-2-integers.pbm/sample-3.inp +1 -0
  77. package/assets/problems/standard/maximum-of-2-integers.pbm/solution.c +18 -0
  78. package/assets/problems/standard/maximum-of-2-integers.pbm/solution.cc +13 -0
  79. package/assets/problems/standard/maximum-of-2-integers.pbm/solution.java +16 -0
  80. package/assets/problems/standard/maximum-of-2-integers.pbm/solution.py +5 -0
  81. package/assets/problems/standard/maximum-of-2-integers.pbm/test-1.inp +1 -0
  82. package/assets/problems/standard/maximum-of-2-integers.pbm/test-2.inp +1 -0
  83. package/assets/problems/standard/maximum-of-2-integers.pbm/test-3.inp +1 -0
  84. package/assets/problems/standard/maximum-of-2-integers.pbm/test-4.inp +1 -0
  85. package/assets/problems/standard/maximum-of-2-integers.pbm/test-5.inp +1 -0
  86. package/assets/problems/standard/treasures-in-a-map.pbm/README.md +12 -0
  87. package/assets/problems/standard/treasures-in-a-map.pbm/atzar.cc +85 -0
  88. package/assets/problems/standard/treasures-in-a-map.pbm/award.png +0 -0
  89. package/assets/problems/standard/treasures-in-a-map.pbm/generate-1.cc +26 -0
  90. package/assets/problems/standard/treasures-in-a-map.pbm/generate-2.cc +26 -0
  91. package/assets/problems/standard/treasures-in-a-map.pbm/generate-3.cc +26 -0
  92. package/assets/problems/standard/treasures-in-a-map.pbm/generate-4.cc +26 -0
  93. package/assets/problems/standard/treasures-in-a-map.pbm/handler.yml +1 -0
  94. package/assets/problems/standard/treasures-in-a-map.pbm/problem.ca.tex +40 -0
  95. package/assets/problems/standard/treasures-in-a-map.pbm/problem.ca.yml +3 -0
  96. package/assets/problems/standard/treasures-in-a-map.pbm/problem.en.tex +40 -0
  97. package/assets/problems/standard/treasures-in-a-map.pbm/problem.en.yml +4 -0
  98. package/assets/problems/standard/treasures-in-a-map.pbm/random-1.inp +24 -0
  99. package/assets/problems/standard/treasures-in-a-map.pbm/random-2.inp +27 -0
  100. package/assets/problems/standard/treasures-in-a-map.pbm/random-3.inp +38 -0
  101. package/assets/problems/standard/treasures-in-a-map.pbm/random-4.inp +50 -0
  102. package/assets/problems/standard/treasures-in-a-map.pbm/sample-1.inp +9 -0
  103. package/assets/problems/standard/treasures-in-a-map.pbm/sample-2.inp +6 -0
  104. package/assets/problems/standard/treasures-in-a-map.pbm/sample-3.inp +7 -0
  105. package/assets/problems/standard/treasures-in-a-map.pbm/solution.cc +38 -0
  106. package/assets/problems/standard/treasures-in-a-map.pbm/test-1.inp +5 -0
  107. package/assets/problems/standard/treasures-in-a-map.pbm/test-2.inp +6 -0
  108. package/assets/problems/standard/treasures-in-a-map.pbm/test-3.inp +6 -0
  109. package/assets/problems/standard/treasures-in-a-map.pbm/test-4.inp +9 -0
  110. package/assets/problems/standard/treasures-in-a-map.pbm/test-5.inp +10 -0
  111. package/assets/problems/standard/treasures-in-a-map.pbm/test-6.inp +9 -0
  112. package/assets/problems/standard/treasures-in-a-map.pbm/test-7.inp +12 -0
  113. package/assets/problems/standard/treasures-in-a-map.pbm/test-8.inp +3 -0
  114. package/assets/problems/standard/treasures-in-a-map.pbm/test-9.inp +37 -0
  115. package/assets/problems/standard/treasures-in-a-map.pbm/test-91.inp +52 -0
  116. package/assets/problems/standard/treasures-in-a-map.pbm/test-92.inp +25 -0
  117. package/assets/problems/standard/treasures-in-a-map.pbm/test-93.inp +3 -0
  118. package/assets/prompts/creators/create-solution.tpl.txt +10 -0
  119. package/assets/prompts/creators/create-statement.tpl.txt +21 -0
  120. package/assets/prompts/creators/create-translation.tpl.txt +5 -0
  121. package/assets/prompts/creators/private-test-cases.txt +6 -0
  122. package/assets/prompts/creators/sample-test-cases.txt +6 -0
  123. package/assets/prompts/creators/system-prompt.txt +2 -0
  124. package/assets/prompts/examples/statement-coda.tex +7 -0
  125. package/assets/prompts/examples/statement.tex +19 -0
  126. package/assets/prompts/generators/efficiency.md +41 -0
  127. package/assets/prompts/generators/hard.md +47 -0
  128. package/assets/prompts/generators/random.md +39 -0
  129. package/assets/prompts/proglangs/cc.md +3 -0
  130. package/assets/prompts/proglangs/py.md +40 -0
  131. package/assets/python/pyexec.py +29 -0
  132. package/assets/sty/judgeit.ca.sty +54 -0
  133. package/assets/sty/judgeit.de.sty +61 -0
  134. package/assets/sty/judgeit.en.sty +60 -0
  135. package/assets/sty/judgeit.es.sty +54 -0
  136. package/assets/sty/judgeit.fr.sty +59 -0
  137. package/assets/sty/judgeit.sty +326 -0
  138. package/assets/sty/picins.sty +579 -0
  139. package/dist/index.js +4246 -0
  140. package/package.json +103 -0
@@ -0,0 +1,5 @@
1
+ 3 4
2
+ ....
3
+ ....
4
+ ....
5
+ 3 4
@@ -0,0 +1,6 @@
1
+ 4 2
2
+ ..
3
+ ..
4
+ t.
5
+ ..
6
+ 3 2
@@ -0,0 +1,6 @@
1
+ 4 3
2
+ .Xt
3
+ .Xt
4
+ XXt
5
+ ttt
6
+ 1 1
@@ -0,0 +1,9 @@
1
+ 7 7
2
+ XXXXXXX
3
+ XtttttX
4
+ XtXXXtX
5
+ XtX.XtX
6
+ XtXXXtX
7
+ XtttttX
8
+ XXXXXXX
9
+ 4 4
@@ -0,0 +1,10 @@
1
+ 8 10
2
+ XXXX....XX
3
+ X....XXXXX
4
+ X.XXXXXXXX
5
+ X.XXX.....
6
+ X.XXX.XXX.
7
+ X.XXt.XXX.
8
+ X.XXXXXXX.
9
+ X.........
10
+ 1 8
@@ -0,0 +1,9 @@
1
+ 7 2
2
+ tt
3
+ tt
4
+ tt
5
+ tt
6
+ tt
7
+ tt
8
+ .t
9
+ 7 1
@@ -0,0 +1,12 @@
1
+ 10 1
2
+ .
3
+ .
4
+ .
5
+ .
6
+ .
7
+ .
8
+ .
9
+ t
10
+ .
11
+ .
12
+ 2 1
@@ -0,0 +1,3 @@
1
+ 1 15
2
+ ..t.........X..
3
+ 1 12
@@ -0,0 +1,37 @@
1
+ 35 34
2
+ ..................................
3
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
4
+ ................................X.
5
+ .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.
6
+ .X............................X.X.
7
+ .X.XXXXXXXXXXXXXXXXXXXXXXXXXX.X.X.
8
+ .X.X........................X.X.X.
9
+ .X.X.XXXXXXXXXXXXXXXXXXXXXX.X.X.X.
10
+ .X.X.X....................X.X.X.X.
11
+ .X.X.X.XXXXXXXXXXXXXXXXXX.X.X.X.X.
12
+ .X.X.X.X................X.X.X.X.X.
13
+ .X.X.X.X.XXXXXXXXXXXXXX.X.X.X.X.X.
14
+ .X.X.X.X.X............X.X.X.X.X.X.
15
+ .X.X.X.X.X.XXXXXXXXXX.X.X.X.X.X.X.
16
+ .X.X.X.X.X.X........X.X.X.X.X.X.X.
17
+ .X.X.X.X.X.X.XXXXXX.X.X.X.X.X.X.X.
18
+ .X.X.X.X.X.X.X....X.X.X.X.X.X.X.X.
19
+ .X.X.X.X.X.X.X.XX.X.X.X.X.X.X.X.X.
20
+ .X.X.X.X.X.X.X.Xt.X.X.X.X.X.X.X.X.
21
+ .X.X.X.X.X.X.X.XXXX.X.X.X.X.X.X.X.
22
+ .X.X.X.X.X.X.X......X.X.X.X.X.X.X.
23
+ .X.X.X.X.X.X.XXXXXXXX.X.X.X.X.X.X.
24
+ .X.X.X.X.X.X..........X.X.X.X.X.X.
25
+ .X.X.X.X.X.XXXXXXXXXXXX.X.X.X.X.X.
26
+ .X.X.X.X.X..............X.X.X.X.X.
27
+ .X.X.X.X.XXXXXXXXXXXXXXXX.X.X.X.X.
28
+ .X.X.X.X..................X.X.X.X.
29
+ .X.X.X.XXXXXXXXXXXXXXXXXXXX.X.X.X.
30
+ .X.X.X......................X.X.X.
31
+ .X.X.XXXXXXXXXXXXXXXXXXXXXXXX.X.X.
32
+ .X.X..........................X.X.
33
+ .X.XXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.
34
+ .X..............................X.
35
+ .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
36
+ ..................................
37
+ 1 1
@@ -0,0 +1,52 @@
1
+ 50 50
2
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3
+ X................................................X
4
+ X.XXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXX.X
5
+ X.Xt...................tX.X............XXXXXXXXX.X
6
+ X.XXXXXXXXXXX.XXXXXXXXXXX.X.XXXXXXXXXX.XXXXXXXXX.X
7
+ X.XXXXXXXXXXX.XXXXXXXXXXX.X.XXXXXXXXXX.XXXXXXXXX.X
8
+ X.XXXXXXXXXXX.XXXXXXXXXXX.X.XXXXXXXXXX.XXXXXXXXX.X
9
+ X.XXXXXXXXXXX.XXXXXXXXXXX.X.Xt................tX.X
10
+ X.......................X.X.XXXXXXXXXXXXXXXXXXXX.X
11
+ XXXXXXXXXXXXX.XXXXXXXXX.X.X......................X
12
+ X..........tX.XXXXXXXXX.X.X.XXXXXXXXXXXXXXXXXXXXXX
13
+ X.XXXXXXXXXXX.XXXXXXXXX.X.X.X....................X
14
+ X.............XXXXXXXXX.X.X.X.XXXXXXXXXXXXXXXXXX.X
15
+ XXXXXXXXXXXXXXXXXXXXXXX.X.X.X.XXXXXXXXXXXXXXXXXX.X
16
+ X.......................X.X.X.........tXXXXXXXXX.X
17
+ X.XXXXXXXXXXXXXXXXXXXXXXX.X.XXXXXXXXXXXXXXXXXXXX.X
18
+ X.X.....................X.X.X....................X
19
+ X.X.XXXXXXXXX.XXXXXXXXX.X.X.X.XXXXXXXXXXXXXXXXXX.X
20
+ X.X.XXXXXXXXX.XXXXXXXXX.X.X.X.XXXXXXXXXXXXXXXXXX.X
21
+ X.X........tX.Xt........X.X.X.........tXXXXXXXXX.X
22
+ X.XXXXXXXXXXX.XXXXXXXXXXX.X.XXXXXXXXXXXXXXXXXXXX.X
23
+ X......................tX.X......................X
24
+ XXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXX
25
+ X...............................................tX
26
+ X.XXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXX
27
+ X.X..........XXXXXX.....X.X......................X
28
+ X.X.XXXXXXXX.XXXXXX.XXX.X.X.XXXXXXXXXX.XXXXXXXXX.X
29
+ X.X.XXXXXXXX.XXXXXX.XXX.X.X.X.......tX.XXXXXXXXX.X
30
+ X.X.XXXtXXXX.XXXXXX.XXX.X.X.X.XXXXXXXX.XXXXXXXXX.X
31
+ X.X.XXX.XXXX.XXXXXX.XXX.X.X.X.XXXXXXXX.XXXXXXXXX.X
32
+ X.X.XXX.XXXX........XXX.X.X.X.XXXXXXXX.XXXXXXXXX.X
33
+ X.X.XXX.XXXX.XXXXXXXXXX.X.X.X........X.Xt........X
34
+ X.X.XXX.XXXX.XXXXXXXXXX.X.X.XXXXXXXX.X.XXXXXXXXXXX
35
+ X.X.XXX.XXXX.XXXXXXXXXX.X.X.XXXXXXXX.X.XXXXXXXXXXX
36
+ X.X.XXX.XXXX.Xt.........X.X.XXXXXXXX.X.XXXXXXXXXXX
37
+ X.X.XXX.XXXX.XXXXXXXXXXXX.X..........X.XXXXXXXXXXX
38
+ X.X.XXX.XXXX............X.XXXXXXXXXXXX.XXXXXXXXXXX
39
+ X.X.XXX.XXXX.XXXXXXXXXX.X.Xt....................tX
40
+ X.X.XXX.XXXX.XXXXXXXXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
41
+ X.X.....XXXX.XXXXXXXXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
42
+ X.XXXXX.XXXX.XXXXXXXXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
43
+ X.XXXXX.XXXX.XXXXXXXXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
44
+ X.XXXXX.XXXX.XXXXXtXXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
45
+ X.XXXXX.XXXX.XXXXX.XXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
46
+ X.XXXXX.XXXX.XXXXX.XXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
47
+ X.XXXXXtXXXX.XXXXX.XXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
48
+ X.XXXXXXXXXX.XXXXX.XXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
49
+ X.XXXXXXXXXX.XXXXX.XXXX.X.XXXXXXXXXXXX.XXXXXXXXXXX
50
+ X............XXXXX......X..............XXXXXXXXXXX
51
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
52
+ 24 26
@@ -0,0 +1,25 @@
1
+ 23 23
2
+ tttttttttttXttttttttttt
3
+ ttttttttttX.Xtttttttttt
4
+ tttttttttX...Xttttttttt
5
+ ttttttttX.....Xtttttttt
6
+ tttttttX.......Xttttttt
7
+ ttttttX.........Xtttttt
8
+ tttttX...........Xttttt
9
+ ttttX.............Xtttt
10
+ tttX...............Xttt
11
+ ttX.................Xtt
12
+ tX...................Xt
13
+ X.....................X
14
+ tX...................Xt
15
+ ttX.................Xtt
16
+ tttX...............Xttt
17
+ ttttX.............Xtttt
18
+ tttttX...........Xttttt
19
+ ttttttX.........Xtttttt
20
+ tttttttX.......Xttttttt
21
+ ttttttttX.....Xtttttttt
22
+ tttttttttX...Xttttttttt
23
+ ttttttttttX.Xtttttttttt
24
+ tttttttttttXttttttttttt
25
+ 12 12
@@ -0,0 +1,10 @@
1
+ Now, write a solution in {{proglang}} to solve this problem
2
+
3
+ It must be written in an idiomatic way and only include relevant comments.
4
+ The code must be efficient and handle all edge cases.
5
+ The code must read from standard input and write to standard output.
6
+ The code must be well written and easy to understand to novices.
7
+ The code does not have to check the preconditions stated in the problem statement.
8
+ Do not use any non-standard libraries.
9
+
10
+ {{proglangPrompt}}
@@ -0,0 +1,21 @@
1
+ You are to write the statement of a programming problem in {{language}}.
2
+
3
+ The statement must be written in LaTeX, using a few predefined macros.
4
+ Use LaTeX math syntax for formulas and variables.
5
+ Use dollars for inline maths and use \[ and \] for display maths.
6
+ Do not add input/output test cases in the statement.
7
+ Separate paragraphs by a blank line and \medskip macro.
8
+
9
+ Write in the style of programming contests like the ACM ICPC or Jutge.org.
10
+
11
+ Here is an example for an unrelated problem in English, follow its structure and macros:
12
+
13
+ {{latexExample}}
14
+
15
+ The title for the new problem is:
16
+
17
+ {{title}}
18
+
19
+ Here is the description of this problem and some additional instructions:
20
+
21
+ {{description}}
@@ -0,0 +1,5 @@
1
+ Now, translate the problem statement to {{language}}.
2
+
3
+ The translation must be accurate and use proper technical terminology.
4
+ Maintain the LaTeX formatting and macros.
5
+ The texts that the program must read and write should not be translated.
@@ -0,0 +1,6 @@
1
+ Now, write a private test case file to check the correctness (not the efficiency) of the program.
2
+
3
+ Only the input should be given, the output will be computed from it.
4
+ Private test cases must be written in plain text format and in the same format that the program reads.
5
+ Private test cases should cover edge cases.
6
+ Limit the number of test cases to a dozen.
@@ -0,0 +1,6 @@
1
+ Now, write a sample test case file to illustrate the input that the program must read according to the problem statement.
2
+
3
+ Only the input should be given, the output will be computed from it.
4
+ Sample test cases must be written in plain text format and in the same format that the program reads.
5
+ Sample test cases should be relatively small but cover interesting cases but not all edge cases.
6
+ If the problem statement features some examples, include them as part of the sample test cases.
@@ -0,0 +1,2 @@
1
+ You are an expert in coding and writing programmming problems.
2
+ You provide accurate information and write following the instructed formats.
@@ -0,0 +1,7 @@
1
+
2
+ \Observation
3
+
4
+ This problem has been generated by Jutge$^{\text{AI}}$. Remove this observation after reviewing it carefully.
5
+
6
+ \Sample
7
+
@@ -0,0 +1,19 @@
1
+ \Problem{Which one is missing?}
2
+
3
+ \Statement
4
+
5
+ Johny has a list of objects, labeled between 1 and $n$, but he lost one of them. He wants to know which one is missing.
6
+
7
+ \medskip
8
+
9
+ Write a program that reads sequences with all the numbers between 1 and $n$ but one, and tells which one is missing.
10
+
11
+ \Input
12
+
13
+ Input consists of several sequences.
14
+ Every sequence begins with a number $n$ between~1 and~$10^4$ followed by $n - 1$ natural numbers.
15
+ Every number between 1 and $n$ appears exactly once, except one of them, which is missing.
16
+
17
+ \Output
18
+
19
+ For every sequence, print the missing number.
@@ -0,0 +1,41 @@
1
+ # Task: Generate Efficiency Input Test Cases
2
+
3
+ Write a program in Python that generates efficiency input test cases according to the specification of the given problem statement.
4
+
5
+ ## Important:
6
+
7
+ - The program should not read any data and should write to standard output.
8
+
9
+ - Its main program should be as follows:
10
+
11
+ ```
12
+ if __name__ == "__main__":
13
+ num_cases = int(sys.argv[1])
14
+ generate_efficiency_test_cases(num_cases)
15
+ ```
16
+
17
+ - Do not change the main program.
18
+
19
+ - Add a docstring to `generate_efficiency_test_cases` explaining what the program does and what categories of random test cases it generates.
20
+
21
+ - Add inline comments explaining each test case category.
22
+
23
+ - Efficiency test cases are those that are specifically designed to challenge the performance and efficiency of the algorithms solving the problem, but not their correctness.
24
+
25
+ - Efficiency test cases should match the problem constraints.
26
+
27
+ - The number of test cases to generate is given as the first command-line argument in the `num_cases` variable.
28
+
29
+ - Do not generate random test cases.
30
+
31
+ - Use type hints when necessary. Do not use old-style type hints such as `List[int]` with `List` imported from `typing`, but use modern syntax such as `list[int]`.
32
+
33
+ - Do not use any non-standard libraries.
34
+
35
+ - Ensure that the generated Python code follows best practices, including proper indentation, use of functions, and adherence to PEP 8 style guidelines.
36
+
37
+ - Only provide the code for the program, without any additional explanations or text.
38
+
39
+ ## Problem statement
40
+
41
+ {{statement}}
@@ -0,0 +1,47 @@
1
+ # Task: Generate Hard Input Test Cases
2
+
3
+ Write a program in Python that generates hard input test cases according to the specification of the given problem statement.
4
+
5
+ ## Important:
6
+
7
+ - The program should not read any data and should write to standard output.
8
+
9
+ - Its main program should be as follows:
10
+
11
+ ```
12
+ if __name__ == "__main__":
13
+ generate_hard_test_cases()
14
+ ```
15
+
16
+ - Do not change the main program.
17
+
18
+ - Add a docstring to `generate_hard_test_cases` explaining what the program does and what categories of random test cases it generates.
19
+
20
+ - Add inline comments explaining each test case category.
21
+
22
+ - Hard cases are those that are specifically designed to challenge the correctness of the algorithms solving the problem, but not its efficiency.
23
+
24
+ - Hard test cases should include:
25
+ - Edge cases that are not covered by typical random test cases.
26
+ - Corner cases that exploit known weaknesses in common algorithms for the problem.
27
+ - Cases that require careful handling of special conditions or constraints.
28
+ - Common pitfalls that might cause incorrect solutions.
29
+ - Degenerate cases that test the robustness of the solution.
30
+
31
+ - But the hard test cases should match the problem constraints.
32
+
33
+ - Do not generate random test cases.
34
+
35
+ - Do not generate test cases to test performance or efficiency.
36
+
37
+ - Use type hints when necessary. Do not use old-style type hints such as `List[int]` with `List` imported from `typing`, but use modern syntax such as `list[int]`.
38
+
39
+ - Do not use any non-standard libraries.
40
+
41
+ - Ensure that the generated Python code follows best practices, including proper indentation, use of functions, and adherence to PEP 8 style guidelines.
42
+
43
+ - Only provide the code for the program, without any additional explanations or text.
44
+
45
+ ## Problem statement
46
+
47
+ {{statement}}
@@ -0,0 +1,39 @@
1
+ # Task: Generate Random Input Test Cases
2
+
3
+ Write a program in Python that generates random input test cases according to the specification of the given problem statement.
4
+
5
+ ## Important:
6
+
7
+ - The program should not read any data and should write to standard output.
8
+
9
+ - Its main program should be as follows:
10
+
11
+ ```
12
+ if __name__ == "__main__":
13
+ num_cases = int(sys.argv[1])
14
+ seed = int(sys.argv[2]) if len(sys.argv) > 2 else 42
15
+ random.seed(seed)
16
+ generate_random_test_cases(num_cases)
17
+ ```
18
+
19
+ - Do not change the main program.
20
+
21
+ - Add a docstring to `generate_random_test_cases` explaining what the program does and what categories of random test cases it generates.
22
+
23
+ - Add inline comments explaining each test case category.
24
+
25
+ - The generated random test cases should match the problem constraints.
26
+
27
+ - The number of test cases to generate is given as the first command-line argument in the `num_cases` variable.
28
+
29
+ - Use type hints when necessary. Do not use old-style type hints such as `List[int]` with `List` imported from `typing`, but use modern syntax such as `list[int]`.
30
+
31
+ - Do not use any non-standard libraries.
32
+
33
+ - Ensure that the generated Python code follows best practices, including proper indentation, use of functions, and adherence to PEP 8 style guidelines.
34
+
35
+ - Only provide the code for the program, without any additional explanations or text.
36
+
37
+ ## Problem statement
38
+
39
+ {{statement}}
@@ -0,0 +1,3 @@
1
+ Do not use fast input/output methods.
2
+
3
+ Add a `using namespace std;` declaration after the includes and do not use `std::` prefixes.
@@ -0,0 +1,40 @@
1
+ Use f-strings for string formatting.
2
+
3
+ Use type hints for function definitions. Do not use old-style type hints such as `List[int]` with `List` imported from `typing`, but use modern syntax such as `list[int]`.
4
+
5
+ Additionally, ensure that the generated Python3 code follows best practices, including proper indentation, use of functions, and adherence to PEP 8 style guidelines.
6
+
7
+ Important: Do not use `input()`, `sys.stdin()`, or `EOFError`` to read input as data can be placed freely across many lines. Instead, use the yogi library:
8
+
9
+ `yogi` provides three functions for reading typed input:
10
+
11
+ **`read(type)`** - Returns the next token as `int`, `float`, or `str`. Raises exception if input ends or type mismatches.
12
+
13
+ ```python
14
+ from yogi import read
15
+ x = read(int) # reads and returns one integer
16
+ ```
17
+
18
+ **`scan(type)`** - Like `read()`, but returns `None` instead of raising exceptions when input ends or type mismatches.
19
+
20
+ ```python
21
+ from yogi import scan
22
+ s = 0
23
+ x = scan(int) # returns int or None
24
+ while x is not None:
25
+ s += x
26
+ x = scan(int) # returns int or None
27
+ print(s)
28
+ ```
29
+
30
+ **`tokens(type)`** - Iterator that yields tokens of specified type until input ends. Raises exception on type mismatch.
31
+
32
+ ```python
33
+ from yogi import tokens
34
+ s = 0
35
+ for x in tokens(int): # iterates over all integers in the input
36
+ s += x
37
+ print(s)
38
+ ```
39
+
40
+ In yogi functions, `type` can be `int`, `float`, or `str`.
@@ -0,0 +1,29 @@
1
+ # type: ignore
2
+
3
+ """
4
+ Execute some Python code given from stdin
5
+ and print all resulting global variables as JSON.
6
+ """
7
+
8
+ import json
9
+ import sys
10
+ import types
11
+
12
+ # Read the code from stdin
13
+ code = sys.stdin.read()
14
+
15
+ # Create a namespace for execution
16
+ namespace = {}
17
+
18
+ # Execute the code in the namespace
19
+ exec(code, namespace)
20
+
21
+ # Filter out built-in variables and imported modules
22
+ variables = {
23
+ key: value
24
+ for key, value in namespace.items()
25
+ if not key.startswith('__') and not isinstance(value, types.ModuleType)
26
+ }
27
+
28
+ # Print the variables as JSON
29
+ print(json.dumps(variables, indent=4))
@@ -0,0 +1,54 @@
1
+ %\usepackage[catalan]{babel}
2
+
3
+ \newcommand{\TxtInput}{Entrada}
4
+ \newcommand{\TxtOutput}{Sortida}
5
+ \newcommand{\TxtSampleSession}{Exemple de sessió}
6
+ \newcommand{\TxtSampleInput}{Exemple d'entrada}
7
+ \newcommand{\TxtSampleOutput}{Exemple de sortida}
8
+ \newcommand{\TxtPrecondition}{Precondició}
9
+ \newcommand{\TxtSamples}{Exemples}
10
+ \newcommand{\TxtObservation}{Observació}
11
+ \newcommand{\TxtObservations}{Observacions}
12
+ \newcommand{\TxtHint}{Pista}
13
+ \newcommand{\TxtScores}{Puntuació}
14
+ \newcommand{\TxtPoints}{Punts}
15
+ \newcommand{\TxtInterface}{Interfície}
16
+
17
+ \newcommand{\TxtSpecification}{Especificació}
18
+ \newcommand{\CheckerInformation}{
19
+ \subsection*{Informació sobre el corrector}
20
+ }
21
+ \newcommand{\TxtObservationElastic}{
22
+ \CheckerInformation
23
+ Podeu escriure les solucions d'aquest exercici en qualsevol ordre.
24
+ }
25
+ \newcommand{\TxtObservationElasticII}{
26
+ \CheckerInformation
27
+ Podeu escriure en qualsevol ordre
28
+ tant les solucions com els elements dins de cada solució.
29
+ }
30
+ \newcommand{\TxtObservationNoMain}{
31
+ Només cal enviar el procediment demanat;
32
+ el programa principal serà ignorat.
33
+ }
34
+ \newcommand{\TxtObservationNoMainPlural}{
35
+ Només cal enviar els procediments demanats;
36
+ el programa principal serà ignorat.
37
+ }
38
+ \newcommand{\TxtTuples}{
39
+ Seguiu estrictament la definició dels tipus de l'enunciat.
40
+ }
41
+ \newcommand{\TxtObservationNoMainTuples}{
42
+ \TxtObservationNoMain
43
+ \TxtTuples
44
+ }
45
+ \newcommand{\TxtObservationNoMainTuplesPlural}{
46
+ \TxtObservationNoMainPlural
47
+ \TxtTuples
48
+ }
49
+
50
+
51
+ \newcommand{\TxtProblemInformation}{Informació del problema}
52
+ \newcommand{\TxtAuthor}{Autor}
53
+ \newcommand{\TxtTranslator}{Traductor}
54
+ \newcommand{\TxtGeneration}{Generació}
@@ -0,0 +1,61 @@
1
+
2
+ % contributed by Volkmar Wörner
3
+
4
+ %\usepackage[ngerman]{babel}
5
+
6
+ \newcommand{\TxtProblemInformation}{Informationen zum Problem}
7
+ \newcommand{\TxtAuthor}{Autor}
8
+ \newcommand{\TxtTranslator}{Übersetzer}
9
+ \newcommand{\TxtGeneration}{Erstellt}
10
+ \newcommand{\TxtInterface}{Interface}
11
+
12
+ \newcommand{\TxtInput}{Eingabe}
13
+ \newcommand{\TxtOutput}{Ausgabe}
14
+ \newcommand{\TxtSampleSession}{Beispiel-Session}
15
+ \newcommand{\TxtSampleInput}{Beispiel-Eingabe}
16
+ \newcommand{\TxtSampleOutput}{Beispiel-Ausgabe}
17
+ \newcommand{\TxtPrecondition}{Vorbedingung}
18
+ \newcommand{\TxtSamples}{Beispiele}
19
+ \newcommand{\TxtObservation}{Beobachtung}
20
+ \newcommand{\TxtObservations}{Beobachtungen}
21
+ \newcommand{\TxtSpecification}{Spezifikation}
22
+ \newcommand{\TxtHint}{Hinweis}
23
+ \newcommand{\TxtScores}{Bewertung}
24
+ \newcommand{\CheckerInformation}{
25
+ \subsection*{Information über den Checker}
26
+ }
27
+ \newcommand{\TxtObservationElastic}{
28
+ \CheckerInformation
29
+ Die Lösungen können in beliebiger Reihenfolge ausgegeben werden.
30
+ }
31
+ \newcommand{\TxtObservationElasticII}{
32
+ \CheckerInformation
33
+ Die Lösungen und die Elemente in jeder Lösung können in beliebiger
34
+ Reihenfolge ausgegeben werden.
35
+ }
36
+ \newcommand{\TxtObservationNoMain}{
37
+ Es muss nur die benötigte Methode abgegeben werden.
38
+ Das Hauptprogramm wird ignoriert.
39
+ }
40
+ \newcommand{\TxtObservationNoMainPlural}{
41
+ Es müssen nur die benötigten Methoden abgegeben werden.
42
+ Das Hauptprogramm wird ignoriert.
43
+ }
44
+ \newcommand{\TxtTuples}{
45
+ Die Typ-Definitionen der Anweisung müssen strikt befolgt werden.
46
+ }
47
+ \newcommand{\TxtObservationNoMainTuples}{
48
+ \TxtObservationNoMain
49
+ \TxtTuples
50
+ }
51
+ \newcommand{\TxtObservationNoMainTuplesPlural}{
52
+ \TxtObservationNoMainPlural
53
+ \TxtTuples
54
+ }
55
+
56
+ \newcommand{\TxtObservationNoMainClasses}{
57
+ Es müssen nur die benötigten Klassen abgegeben werden.
58
+ Das Hauptprogramm wird ignoriert.
59
+ \TxtTuples
60
+ }
61
+
@@ -0,0 +1,60 @@
1
+ %\usepackage[english]{babel}
2
+
3
+ \newcommand{\TxtInput}{Input}
4
+ \newcommand{\TxtOutput}{Output}
5
+ \newcommand{\TxtSampleSession}{Sample session}
6
+ \newcommand{\TxtSampleInput}{Sample input}
7
+ \newcommand{\TxtSampleOutput}{Sample output}
8
+ \newcommand{\TxtPrecondition}{Precondition}
9
+ \newcommand{\TxtSamples}{Samples}
10
+ \newcommand{\TxtObservation}{Observation}
11
+ \newcommand{\TxtObservations}{Observations}
12
+ \newcommand{\TxtHint}{Hint}
13
+ \newcommand{\TxtScores}{Scoring}
14
+ \newcommand{\TxtPoints}{Points}
15
+ \newcommand{\TxtInterface}{Interface}
16
+
17
+
18
+ \newcommand{\TxtSpecification}{Specification}
19
+ \newcommand{\CheckerInformation}{
20
+ \subsection*{Information about the checker}
21
+ }
22
+ \newcommand{\TxtObservationElastic}{
23
+ \CheckerInformation
24
+ You can print the solutions to this exercise in any order.
25
+ }
26
+ \newcommand{\TxtObservationElasticII}{
27
+ \CheckerInformation
28
+ You can print in any order
29
+ both the solutions and the elements inside each solution.
30
+ }
31
+ \newcommand{\TxtObservationNoMain}{
32
+ You only need to submit the required procedure;
33
+ your main program will be ignored.
34
+ }
35
+ \newcommand{\TxtObservationNoMainPlural}{
36
+ You only need to submit the required procedures;
37
+ your main program will be ignored.
38
+ }
39
+ \newcommand{\TxtTuples}{
40
+ Strictly obey the type definitions of the statement.
41
+ }
42
+ \newcommand{\TxtObservationNoMainTuples}{
43
+ You only need to submit the required classes;
44
+ your main program will be ignored.
45
+ \TxtTuples
46
+ }
47
+ \newcommand{\TxtObservationNoMainClasses}{
48
+ \TxtObservationNoMain
49
+ \TxtTuples
50
+ }
51
+ \newcommand{\TxtObservationNoMainTuplesPlural}{
52
+ \TxtObservationNoMainPlural
53
+ \TxtTuples
54
+ }
55
+
56
+
57
+ \newcommand{\TxtProblemInformation}{Problem information}
58
+ \newcommand{\TxtAuthor}{Author}
59
+ \newcommand{\TxtTranslator}{Translator}
60
+ \newcommand{\TxtGeneration}{Generation}