rbx.cp 0.5.42__py3-none-any.whl → 0.5.46__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 (54) hide show
  1. rbx/box/cli.py +8 -0
  2. rbx/box/code.py +76 -3
  3. rbx/box/generators.py +77 -40
  4. rbx/box/main.py +0 -4
  5. rbx/box/package.py +16 -2
  6. rbx/box/solutions.py +5 -3
  7. rbx/box/state.py +1 -0
  8. rbx/box/statements/builders.py +22 -3
  9. rbx/box/tasks.py +32 -5
  10. rbx/box/testcase_utils.py +66 -0
  11. rbx/grading/judge/cacher.py +0 -4
  12. rbx/grading/judge/digester.py +0 -3
  13. rbx/grading/judge/sandbox.py +7 -0
  14. rbx/grading/judge/sandboxes/isolate.py +2 -2
  15. rbx/grading/judge/sandboxes/stupid_sandbox.py +11 -2
  16. rbx/grading/judge/sandboxes/timeit.py +109 -5
  17. rbx/grading/judge/storage.py +0 -4
  18. rbx/main.py +0 -4
  19. {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.46.dist-info}/METADATA +1 -2
  20. {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.46.dist-info}/RECORD +23 -54
  21. {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.46.dist-info}/WHEEL +1 -1
  22. rbx/testdata/box1/gen1.cpp +0 -7
  23. rbx/testdata/box1/gen2.cpp +0 -9
  24. rbx/testdata/box1/genScript.py +0 -2
  25. rbx/testdata/box1/hard-tle.sol.cpp +0 -26
  26. rbx/testdata/box1/ole.cpp +0 -17
  27. rbx/testdata/box1/problem.rbx.yml +0 -39
  28. rbx/testdata/box1/re.sol.cpp +0 -23
  29. rbx/testdata/box1/sol.cpp +0 -22
  30. rbx/testdata/box1/tests/1.in +0 -1
  31. rbx/testdata/box1/tle-and-incorrect.sol.cpp +0 -33
  32. rbx/testdata/box1/tle.sol.cpp +0 -35
  33. rbx/testdata/box1/validator.cpp +0 -11
  34. rbx/testdata/box1/wa.sol.cpp +0 -22
  35. rbx/testdata/caching/executable.py +0 -1
  36. rbx/testdata/compatible +0 -0
  37. rbx/testdata/interactive/checker.cpp +0 -21
  38. rbx/testdata/interactive/gen.cpp +0 -11
  39. rbx/testdata/interactive/interactor.cpp +0 -63
  40. rbx/testdata/interactive/problem.rbx.yml +0 -40
  41. rbx/testdata/interactive/sols/af_ac_pe.cpp +0 -75
  42. rbx/testdata/interactive/sols/af_ac_re.cpp +0 -76
  43. rbx/testdata/interactive/sols/af_ac_too_many_iter.cpp +0 -72
  44. rbx/testdata/interactive/sols/af_inf_cout_with_flush.cpp +0 -79
  45. rbx/testdata/interactive/sols/af_inf_cout_without_flush.cpp +0 -78
  46. rbx/testdata/interactive/sols/af_ml.cpp +0 -78
  47. rbx/testdata/interactive/sols/af_tl_after_ans.cpp +0 -74
  48. rbx/testdata/interactive/sols/af_wa.cpp +0 -74
  49. rbx/testdata/interactive/sols/interactive-binary-search_mm_naive_cin.cpp +0 -17
  50. rbx/testdata/interactive/sols/main.cpp +0 -26
  51. rbx/testdata/interactive/testplan.txt +0 -6
  52. rbx/testdata/interactive/validator.cpp +0 -16
  53. {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.46.dist-info}/LICENSE +0 -0
  54. {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.46.dist-info}/entry_points.txt +0 -0
@@ -1,21 +0,0 @@
1
- #include "testlib.h"
2
-
3
- int main(int argc, char *argv[]) {
4
- registerTestlibCmd(argc, argv);
5
-
6
- int oufq = ouf.readInt();
7
- int ansq = ans.readInt();
8
-
9
- if (ansq > 25)
10
- quitf(_fail, "Limit is %d, but main solution have made %d queries", 25,
11
- ansq);
12
-
13
- if (oufq > 25)
14
- quitf(_wa, "Limit is %d, but solution have made %d queries", 25, oufq);
15
-
16
- int n = inf.readInt();
17
- int m = inf.readInt();
18
- quitf(_ok,
19
- "Number %d is guessed successfully (range [1..%d]) with %d queries", n,
20
- m, oufq);
21
- }
@@ -1,11 +0,0 @@
1
- #include "testlib.h"
2
- #include <bits/stdc++.h>
3
-
4
- using namespace std;
5
-
6
- int main(int argc, char *argv[]) {
7
- registerGen(argc, argv, 1);
8
- int n = atoi(argv[1]);
9
- int t = atoi(argv[2]);
10
- cout << rnd.wnext(1, n, t) << ' ' << n << endl;
11
- }
@@ -1,63 +0,0 @@
1
- #include "testlib.h"
2
- #include <bits/stdc++.h>
3
-
4
- using namespace std;
5
-
6
- void upd(int &lf, int &rg, int x, int y) {
7
- if (x > y)
8
- return;
9
- lf = max(lf, x);
10
- rg = min(rg, y);
11
- }
12
-
13
- void send(string x) {
14
- cout << x << endl;
15
- fflush(stdout);
16
- }
17
-
18
- const int INF = 1000'000'000;
19
-
20
- int main(int argc, char *argv[]) {
21
- registerInteraction(argc, argv);
22
-
23
- int x = inf.readInt();
24
- int n = inf.readInt();
25
- cout << n << endl << flush;
26
- int lf = 1, rg = n;
27
-
28
- int queries = 0;
29
- while (true) {
30
- bool is_answer = false;
31
- string cur = ouf.readToken("!|[1-9][0-9]{0,8}");
32
- int last;
33
- if (cur != "!") {
34
- InStream tmp(ouf, cur);
35
- last = tmp.readInt(-INF, INF);
36
- queries++;
37
- } else {
38
- is_answer = true;
39
- last = ouf.readInt(-INF, INF);
40
- }
41
-
42
- if (last < 1 || last > n)
43
- quitf(_pe, "number %d from stdin is out of range [%d, %d]", last, 1, n);
44
-
45
- if (is_answer) {
46
- if (last == x && lf == rg) {
47
- tout << queries << endl;
48
- quitf(_ok, "number is guessed.");
49
- } else if (last == x && lf != rg)
50
- quitf(_wa, "number is but it was made in a random way");
51
- else
52
- quitf(_wa, "guessed number is incorrect");
53
- }
54
-
55
- if (x < last) {
56
- send("<");
57
- upd(lf, rg, 1, last - 1);
58
- } else {
59
- send(">=");
60
- upd(lf, rg, last, n);
61
- }
62
- }
63
- }
@@ -1,40 +0,0 @@
1
- ---
2
- name: "test-problem"
3
- type: communication
4
- timeLimit: 1000
5
- memoryLimit: 256
6
- outputLimit: 100 # 100 kb
7
- checker:
8
- path: "checker.cpp"
9
- interactor:
10
- path: "interactor.cpp"
11
- generators:
12
- - name: "gen"
13
- path: "gen.cpp"
14
- validator:
15
- path: "validator.cpp"
16
- testcases:
17
- - name: "tests"
18
- generatorScript:
19
- path: "testplan.txt"
20
- solutions:
21
- - path: "sols/main.cpp"
22
- outcome: AC
23
- - path: "sols/interactive-binary-search_mm_naive_cin.cpp"
24
- outcome: INCORRECT
25
- - path: "sols/af_tl_after_ans.cpp"
26
- outcome: TLE
27
- - path: "sols/af_wa.cpp"
28
- outcome: WA
29
- - path: "sols/af_ac_pe.cpp"
30
- outcome: WA
31
- - path: "sols/af_ac_re.cpp"
32
- outcome: RE
33
- - path: "sols/af_ml.cpp"
34
- outcome: ML
35
- - path: "sols/af_inf_cout_without_flush.cpp"
36
- outcome: TLE
37
- - path: "sols/af_inf_cout_with_flush.cpp"
38
- outcome: TLE
39
- - path: "sols/af_ac_too_many_iter.cpp"
40
- outcome: INCORRECT
@@ -1,75 +0,0 @@
1
- #include <algorithm>
2
- #include <cassert>
3
- #include <cmath>
4
- #include <cstdio>
5
- #include <cstring>
6
- #include <ctime>
7
- #include <iomanip>
8
- #include <iostream>
9
- #include <map>
10
- #include <queue>
11
- #include <set>
12
- #include <sstream>
13
- #include <string>
14
- #include <vector>
15
-
16
- #define forn(i, n) for (int i = 0; i < n; ++i)
17
- #define fore(i, l, r) for (int i = int(l); i <= int(r); ++i)
18
- #define sz(v) int(v.size())
19
- #define all(v) v.begin(), v.end()
20
- #define pb push_back
21
- #define mp make_pair
22
- #define x first
23
- #define y1 ________y1
24
- #define y second
25
- #define ft first
26
- #define sc second
27
- #define pt pair<int, int>
28
-
29
- template <typename X> inline X abs(const X &a) { return a < 0 ? -a : a; }
30
- template <typename X> inline X sqr(const X &a) { return a * a; }
31
-
32
- typedef long long li;
33
- typedef long double ld;
34
-
35
- using namespace std;
36
-
37
- const int INF = 1000 * 1000 * 1000;
38
- const ld EPS = 1e-9;
39
- const ld PI = acos(-1.0);
40
-
41
- int n;
42
- int lf, rg;
43
-
44
- bool read() {
45
- cin >> n;
46
- return true;
47
- }
48
-
49
- void solve() {
50
- lf = 1, rg = n;
51
- int it = 0;
52
- while (lf != rg) {
53
- it++;
54
- int mid = (lf + rg + 1) / 2;
55
- cout << mid << endl;
56
- fflush(stdout);
57
- string s;
58
- cin >> s;
59
- if (s == "<")
60
- rg = mid - 1;
61
- else
62
- lf = mid;
63
- }
64
- if (it > 15)
65
- cout << "!!";
66
- cout << "! " << lf << endl;
67
- }
68
-
69
- int main() {
70
- srand(time(NULL));
71
- cerr << setprecision(10) << fixed;
72
- assert(read());
73
- solve();
74
- return 0;
75
- }
@@ -1,76 +0,0 @@
1
- #include <algorithm>
2
- #include <cassert>
3
- #include <cmath>
4
- #include <cstdio>
5
- #include <cstring>
6
- #include <ctime>
7
- #include <iomanip>
8
- #include <iostream>
9
- #include <map>
10
- #include <queue>
11
- #include <set>
12
- #include <sstream>
13
- #include <string>
14
- #include <vector>
15
-
16
- #define forn(i, n) for (int i = 0; i < n; ++i)
17
- #define fore(i, l, r) for (int i = int(l); i <= int(r); ++i)
18
- #define sz(v) int(v.size())
19
- #define all(v) v.begin(), v.end()
20
- #define pb push_back
21
- #define mp make_pair
22
- #define x first
23
- #define y1 ________y1
24
- #define y second
25
- #define ft first
26
- #define sc second
27
- #define pt pair<int, int>
28
-
29
- template <typename X> inline X abs(const X &a) { return a < 0 ? -a : a; }
30
- template <typename X> inline X sqr(const X &a) { return a * a; }
31
-
32
- typedef long long li;
33
- typedef long double ld;
34
-
35
- using namespace std;
36
-
37
- const int INF = 1000 * 1000 * 1000;
38
- const ld EPS = 1e-9;
39
- const ld PI = acos(-1.0);
40
-
41
- int n;
42
- int lf, rg;
43
-
44
- bool read() {
45
- cin >> n;
46
- return true;
47
- }
48
-
49
- void solve() {
50
- lf = 1, rg = n;
51
- int it = 0;
52
- while (lf != rg) {
53
- it++;
54
- int mid = (lf + rg + 1) / 2;
55
- cout << mid << endl;
56
- fflush(stdout);
57
- string s;
58
- cin >> s;
59
- if (s == "<")
60
- rg = mid - 1;
61
- else
62
- lf = mid;
63
- if (it > 15)
64
- assert(false);
65
- }
66
-
67
- cout << "! " << lf << endl;
68
- }
69
-
70
- int main() {
71
- srand(time(NULL));
72
- cerr << setprecision(10) << fixed;
73
- assert(read());
74
- solve();
75
- return 0;
76
- }
@@ -1,72 +0,0 @@
1
- #include <algorithm>
2
- #include <cassert>
3
- #include <cmath>
4
- #include <cstdio>
5
- #include <cstring>
6
- #include <ctime>
7
- #include <iomanip>
8
- #include <iostream>
9
- #include <map>
10
- #include <queue>
11
- #include <set>
12
- #include <sstream>
13
- #include <string>
14
- #include <vector>
15
-
16
- #define forn(i, n) for (int i = 0; i < n; ++i)
17
- #define fore(i, l, r) for (int i = int(l); i <= int(r); ++i)
18
- #define sz(v) int(v.size())
19
- #define all(v) v.begin(), v.end()
20
- #define pb push_back
21
- #define mp make_pair
22
- #define x first
23
- #define y1 ________y1
24
- #define y second
25
- #define ft first
26
- #define sc second
27
- #define pt pair<int, int>
28
-
29
- template <typename X> inline X abs(const X &a) { return a < 0 ? -a : a; }
30
- template <typename X> inline X sqr(const X &a) { return a * a; }
31
-
32
- typedef long long li;
33
- typedef long double ld;
34
-
35
- using namespace std;
36
-
37
- const int INF = 1000 * 1000 * 1000;
38
- const ld EPS = 1e-9;
39
- const ld PI = acos(-1.0);
40
-
41
- int n;
42
- int lf, rg;
43
-
44
- bool read() {
45
- cin >> n;
46
- return true;
47
- }
48
-
49
- void solve() {
50
- lf = 1, rg = n;
51
- while (lf != rg) {
52
- int mid = (lf + rg + 1) / 2;
53
- cout << mid << endl;
54
- fflush(stdout);
55
- string s;
56
- cin >> s;
57
- if (s == "<")
58
- rg--;
59
- else
60
- lf = mid;
61
- }
62
-
63
- cout << "! " << lf << endl;
64
- }
65
-
66
- int main() {
67
- srand(time(NULL));
68
- cerr << setprecision(10) << fixed;
69
- assert(read());
70
- solve();
71
- return 0;
72
- }
@@ -1,79 +0,0 @@
1
- #include <algorithm>
2
- #include <cassert>
3
- #include <cmath>
4
- #include <cstdio>
5
- #include <cstring>
6
- #include <ctime>
7
- #include <iomanip>
8
- #include <iostream>
9
- #include <map>
10
- #include <queue>
11
- #include <set>
12
- #include <sstream>
13
- #include <string>
14
- #include <vector>
15
-
16
- #define forn(i, n) for (int i = 0; i < n; ++i)
17
- #define fore(i, l, r) for (int i = int(l); i <= int(r); ++i)
18
- #define sz(v) int(v.size())
19
- #define all(v) v.begin(), v.end()
20
- #define pb push_back
21
- #define mp make_pair
22
- #define x first
23
- #define y1 ________y1
24
- #define y second
25
- #define ft first
26
- #define sc second
27
- #define pt pair<int, int>
28
-
29
- template <typename X> inline X abs(const X &a) { return a < 0 ? -a : a; }
30
- template <typename X> inline X sqr(const X &a) { return a * a; }
31
-
32
- typedef long long li;
33
- typedef long double ld;
34
-
35
- using namespace std;
36
-
37
- const int INF = 1000 * 1000 * 1000;
38
- const ld EPS = 1e-9;
39
- const ld PI = acos(-1.0);
40
-
41
- int n;
42
- int lf, rg;
43
-
44
- bool read() {
45
- cin >> n;
46
- return true;
47
- }
48
-
49
- void solve() {
50
- lf = 1, rg = n;
51
- int it = 0;
52
- while (rg - lf > 0) {
53
- it++;
54
- int mid = (lf + rg + 1) / 2;
55
- cout << mid << endl;
56
- fflush(stdout);
57
- string s;
58
- cin >> s;
59
- if (s == "<")
60
- rg = mid - 1;
61
- else
62
- lf = mid;
63
- if (it > 5) {
64
- while (true) {
65
- cout << rand() % n + 1;
66
- fflush(stdout);
67
- }
68
- }
69
- }
70
- cout << "! " << lf << endl;
71
- }
72
-
73
- int main() {
74
- srand(time(NULL));
75
- cerr << setprecision(10) << fixed;
76
- assert(read());
77
- solve();
78
- return 0;
79
- }
@@ -1,78 +0,0 @@
1
- #include <algorithm>
2
- #include <cassert>
3
- #include <cmath>
4
- #include <cstdio>
5
- #include <cstring>
6
- #include <ctime>
7
- #include <iomanip>
8
- #include <iostream>
9
- #include <map>
10
- #include <queue>
11
- #include <set>
12
- #include <sstream>
13
- #include <string>
14
- #include <vector>
15
-
16
- #define forn(i, n) for (int i = 0; i < n; ++i)
17
- #define fore(i, l, r) for (int i = int(l); i <= int(r); ++i)
18
- #define sz(v) int(v.size())
19
- #define all(v) v.begin(), v.end()
20
- #define pb push_back
21
- #define mp make_pair
22
- #define x first
23
- #define y1 ________y1
24
- #define y second
25
- #define ft first
26
- #define sc second
27
- #define pt pair<int, int>
28
-
29
- template <typename X> inline X abs(const X &a) { return a < 0 ? -a : a; }
30
- template <typename X> inline X sqr(const X &a) { return a * a; }
31
-
32
- typedef long long li;
33
- typedef long double ld;
34
-
35
- using namespace std;
36
-
37
- const int INF = 1000 * 1000 * 1000;
38
- const ld EPS = 1e-9;
39
- const ld PI = acos(-1.0);
40
-
41
- int n;
42
- int lf, rg;
43
-
44
- bool read() {
45
- cin >> n;
46
- return true;
47
- }
48
-
49
- void solve() {
50
- lf = 1, rg = n;
51
- int it = 0;
52
- while (rg - lf > 0) {
53
- it++;
54
- int mid = (lf + rg + 1) / 2;
55
- cout << mid << endl;
56
- fflush(stdout);
57
- string s;
58
- cin >> s;
59
- if (s == "<")
60
- rg = mid - 1;
61
- else
62
- lf = mid;
63
- if (it > 5) {
64
- while (true) {
65
- cout << rand() % n + 1;
66
- }
67
- }
68
- }
69
- cout << "! " << lf << endl;
70
- }
71
-
72
- int main() {
73
- srand(time(NULL));
74
- cerr << setprecision(10) << fixed;
75
- assert(read());
76
- solve();
77
- return 0;
78
- }
@@ -1,78 +0,0 @@
1
- #include <algorithm>
2
- #include <cassert>
3
- #include <cmath>
4
- #include <cstdio>
5
- #include <cstring>
6
- #include <ctime>
7
- #include <iomanip>
8
- #include <iostream>
9
- #include <map>
10
- #include <queue>
11
- #include <set>
12
- #include <sstream>
13
- #include <string>
14
- #include <vector>
15
-
16
- #define forn(i, n) for (int i = 0; i < n; ++i)
17
- #define fore(i, l, r) for (int i = int(l); i <= int(r); ++i)
18
- #define sz(v) int(v.size())
19
- #define all(v) v.begin(), v.end()
20
- #define pb push_back
21
- #define mp make_pair
22
- #define x first
23
- #define y1 ________y1
24
- #define y second
25
- #define ft first
26
- #define sc second
27
- #define pt pair<int, int>
28
-
29
- template <typename X> inline X abs(const X &a) { return a < 0 ? -a : a; }
30
- template <typename X> inline X sqr(const X &a) { return a * a; }
31
-
32
- typedef long long li;
33
- typedef long double ld;
34
-
35
- using namespace std;
36
-
37
- const int INF = 1000 * 1000 * 1000;
38
- const ld EPS = 1e-9;
39
- const ld PI = acos(-1.0);
40
-
41
- int n;
42
- int lf, rg;
43
-
44
- bool read() {
45
- cin >> n;
46
- return true;
47
- }
48
-
49
- void solve() {
50
- lf = 1, rg = n;
51
- vector<int> was;
52
- int it = 0;
53
- while (lf != rg) {
54
- it++;
55
- int mid = (lf + rg + 1) / 2;
56
- if (it > 5)
57
- for (int i = 0; i < 10000000; i++)
58
- was.pb(rand());
59
- cout << mid << endl;
60
- fflush(stdout);
61
- string s;
62
- cin >> s;
63
- if (s == "<")
64
- rg = mid - 1;
65
- else
66
- lf = mid;
67
- }
68
-
69
- cout << "! " << lf << endl;
70
- }
71
-
72
- int main() {
73
- srand(time(NULL));
74
- cerr << setprecision(10) << fixed;
75
- assert(read());
76
- solve();
77
- return 0;
78
- }
@@ -1,74 +0,0 @@
1
- #include <algorithm>
2
- #include <cassert>
3
- #include <cmath>
4
- #include <cstdio>
5
- #include <cstring>
6
- #include <ctime>
7
- #include <iomanip>
8
- #include <iostream>
9
- #include <map>
10
- #include <queue>
11
- #include <set>
12
- #include <sstream>
13
- #include <string>
14
- #include <vector>
15
-
16
- #define forn(i, n) for (int i = 0; i < n; ++i)
17
- #define fore(i, l, r) for (int i = int(l); i <= int(r); ++i)
18
- #define sz(v) int(v.size())
19
- #define all(v) v.begin(), v.end()
20
- #define pb push_back
21
- #define mp make_pair
22
- #define x first
23
- #define y1 ________y1
24
- #define y second
25
- #define ft first
26
- #define sc second
27
- #define pt pair<int, int>
28
-
29
- template <typename X> inline X abs(const X &a) { return a < 0 ? -a : a; }
30
- template <typename X> inline X sqr(const X &a) { return a * a; }
31
-
32
- typedef long long li;
33
- typedef long double ld;
34
-
35
- using namespace std;
36
-
37
- const int INF = 1000 * 1000 * 1000;
38
- const ld EPS = 1e-9;
39
- const ld PI = acos(-1.0);
40
-
41
- int n;
42
- int lf, rg;
43
-
44
- bool read() {
45
- cin >> n;
46
- return true;
47
- }
48
-
49
- void solve() {
50
- lf = 1, rg = n;
51
- while (lf != rg) {
52
- int mid = (lf + rg + 1) / 2;
53
- cout << mid << endl;
54
- fflush(stdout);
55
- string s;
56
- cin >> s;
57
- if (s == "<")
58
- rg = mid - 1;
59
- else
60
- lf = mid;
61
- }
62
-
63
- cout << "! " << lf << endl;
64
- while (true) {
65
- }
66
- }
67
-
68
- int main() {
69
- srand(time(NULL));
70
- cerr << setprecision(10) << fixed;
71
- assert(read());
72
- solve();
73
- return 0;
74
- }