rbx.cp 0.5.42__py3-none-any.whl → 0.5.45__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/cli.py +8 -0
- rbx/box/code.py +76 -3
- rbx/box/main.py +0 -4
- rbx/box/package.py +16 -2
- rbx/box/state.py +1 -0
- rbx/box/tasks.py +20 -1
- rbx/grading/judge/cacher.py +0 -4
- rbx/grading/judge/digester.py +0 -3
- rbx/grading/judge/sandbox.py +7 -0
- rbx/grading/judge/sandboxes/stupid_sandbox.py +10 -1
- rbx/grading/judge/sandboxes/timeit.py +109 -5
- rbx/grading/judge/storage.py +0 -4
- rbx/main.py +0 -4
- {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.45.dist-info}/METADATA +1 -2
- {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.45.dist-info}/RECORD +18 -49
- {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.45.dist-info}/WHEEL +1 -1
- rbx/testdata/box1/gen1.cpp +0 -7
- rbx/testdata/box1/gen2.cpp +0 -9
- rbx/testdata/box1/genScript.py +0 -2
- rbx/testdata/box1/hard-tle.sol.cpp +0 -26
- rbx/testdata/box1/ole.cpp +0 -17
- rbx/testdata/box1/problem.rbx.yml +0 -39
- rbx/testdata/box1/re.sol.cpp +0 -23
- rbx/testdata/box1/sol.cpp +0 -22
- rbx/testdata/box1/tests/1.in +0 -1
- rbx/testdata/box1/tle-and-incorrect.sol.cpp +0 -33
- rbx/testdata/box1/tle.sol.cpp +0 -35
- rbx/testdata/box1/validator.cpp +0 -11
- rbx/testdata/box1/wa.sol.cpp +0 -22
- rbx/testdata/caching/executable.py +0 -1
- rbx/testdata/compatible +0 -0
- rbx/testdata/interactive/checker.cpp +0 -21
- rbx/testdata/interactive/gen.cpp +0 -11
- rbx/testdata/interactive/interactor.cpp +0 -63
- rbx/testdata/interactive/problem.rbx.yml +0 -40
- rbx/testdata/interactive/sols/af_ac_pe.cpp +0 -75
- rbx/testdata/interactive/sols/af_ac_re.cpp +0 -76
- rbx/testdata/interactive/sols/af_ac_too_many_iter.cpp +0 -72
- rbx/testdata/interactive/sols/af_inf_cout_with_flush.cpp +0 -79
- rbx/testdata/interactive/sols/af_inf_cout_without_flush.cpp +0 -78
- rbx/testdata/interactive/sols/af_ml.cpp +0 -78
- rbx/testdata/interactive/sols/af_tl_after_ans.cpp +0 -74
- rbx/testdata/interactive/sols/af_wa.cpp +0 -74
- rbx/testdata/interactive/sols/interactive-binary-search_mm_naive_cin.cpp +0 -17
- rbx/testdata/interactive/sols/main.cpp +0 -26
- rbx/testdata/interactive/testplan.txt +0 -6
- rbx/testdata/interactive/validator.cpp +0 -16
- {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.45.dist-info}/LICENSE +0 -0
- {rbx_cp-0.5.42.dist-info → rbx_cp-0.5.45.dist-info}/entry_points.txt +0 -0
rbx/testdata/box1/gen2.cpp
DELETED
rbx/testdata/box1/genScript.py
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#include <bits/stdc++.h>
|
2
|
-
#include <ctime>
|
3
|
-
|
4
|
-
using namespace std;
|
5
|
-
|
6
|
-
void busy_loop() {
|
7
|
-
double wait = 5.0;
|
8
|
-
int start = clock();
|
9
|
-
int end = clock();
|
10
|
-
while (((double) (end - start)) / CLOCKS_PER_SEC < wait)
|
11
|
-
{
|
12
|
-
end = clock();
|
13
|
-
}
|
14
|
-
}
|
15
|
-
|
16
|
-
int32_t main() {
|
17
|
-
ios::sync_with_stdio(false);
|
18
|
-
cin.tie(0);
|
19
|
-
|
20
|
-
int n; cin >> n;
|
21
|
-
|
22
|
-
busy_loop();
|
23
|
-
|
24
|
-
cout << "hard" << endl;
|
25
|
-
return 0;
|
26
|
-
}
|
rbx/testdata/box1/ole.cpp
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
|
2
|
-
#include <bits/stdc++.h>
|
3
|
-
|
4
|
-
using namespace std;
|
5
|
-
|
6
|
-
int32_t main() {
|
7
|
-
ios::sync_with_stdio(false);
|
8
|
-
cin.tie(0);
|
9
|
-
|
10
|
-
int n;
|
11
|
-
cin >> n;
|
12
|
-
|
13
|
-
for (int i = 1; i <= 100000; i++) { // more than output limit of 100kb
|
14
|
-
cout << 123456 << "\n";
|
15
|
-
}
|
16
|
-
return 0;
|
17
|
-
}
|
@@ -1,39 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: "test-problem"
|
3
|
-
timeLimit: 1000
|
4
|
-
memoryLimit: 256
|
5
|
-
outputLimit: 100 # 100 kb
|
6
|
-
generators:
|
7
|
-
- name: "gen1"
|
8
|
-
path: "gen1.cpp"
|
9
|
-
- name: "gen2"
|
10
|
-
path: "gen2.cpp"
|
11
|
-
validator:
|
12
|
-
path: "validator.cpp"
|
13
|
-
testcases:
|
14
|
-
- name: "gen1"
|
15
|
-
testcaseGlob: "tests/*.in"
|
16
|
-
subgroups:
|
17
|
-
- name: "gen"
|
18
|
-
generators:
|
19
|
-
- name: "gen1"
|
20
|
-
- name: "gen2"
|
21
|
-
args: "424242"
|
22
|
-
- name: "genScript"
|
23
|
-
generatorScript:
|
24
|
-
path: "genScript.py"
|
25
|
-
solutions:
|
26
|
-
- path: "sol.cpp"
|
27
|
-
outcome: "ac"
|
28
|
-
- path: "wa.sol.cpp"
|
29
|
-
outcome: "fail"
|
30
|
-
- path: "re.sol.cpp"
|
31
|
-
outcome: "rte"
|
32
|
-
- path: "tle.sol.cpp"
|
33
|
-
outcome: "tle"
|
34
|
-
- path: "tle-and-incorrect.sol.cpp"
|
35
|
-
outcome: "tle"
|
36
|
-
- path: "hard-tle.sol.cpp"
|
37
|
-
outcome: "tle"
|
38
|
-
- path: "ole.cpp"
|
39
|
-
outcome: "ole"
|
rbx/testdata/box1/re.sol.cpp
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
#include <bits/stdc++.h>
|
2
|
-
|
3
|
-
using namespace std;
|
4
|
-
|
5
|
-
int32_t main() {
|
6
|
-
ios::sync_with_stdio(false);
|
7
|
-
cin.tie(0);
|
8
|
-
|
9
|
-
int n; cin >> n;
|
10
|
-
|
11
|
-
vector<int> divisors;
|
12
|
-
assert(false);
|
13
|
-
for(int i = 0; i*i <= n; i++) {
|
14
|
-
if (n % i == 0) {
|
15
|
-
divisors.push_back(i);
|
16
|
-
divisors.push_back(n/i);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
sort(divisors.begin(), divisors.end());
|
21
|
-
for (int x : divisors) cout << x << '\n';
|
22
|
-
return 0;
|
23
|
-
}
|
rbx/testdata/box1/sol.cpp
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
#include <bits/stdc++.h>
|
2
|
-
|
3
|
-
using namespace std;
|
4
|
-
|
5
|
-
int32_t main() {
|
6
|
-
ios::sync_with_stdio(false);
|
7
|
-
cin.tie(0);
|
8
|
-
|
9
|
-
int n; cin >> n;
|
10
|
-
|
11
|
-
vector<int> divisors;
|
12
|
-
for(int i = 1; i*i <= n; i++) {
|
13
|
-
if (n % i == 0) {
|
14
|
-
divisors.push_back(i);
|
15
|
-
if (i != n/i) divisors.push_back(n/i);
|
16
|
-
}
|
17
|
-
}
|
18
|
-
|
19
|
-
sort(divisors.begin(), divisors.end());
|
20
|
-
for (int x : divisors) cout << x << '\n';
|
21
|
-
return 0;
|
22
|
-
}
|
rbx/testdata/box1/tests/1.in
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
777
|
@@ -1,33 +0,0 @@
|
|
1
|
-
#include <bits/stdc++.h>
|
2
|
-
#include <ctime>
|
3
|
-
|
4
|
-
using namespace std;
|
5
|
-
|
6
|
-
void busy_loop() {
|
7
|
-
double wait = 1.0;
|
8
|
-
int start = clock();
|
9
|
-
int end = clock();
|
10
|
-
while (((double) (end - start)) / CLOCKS_PER_SEC < wait)
|
11
|
-
{
|
12
|
-
end = clock();
|
13
|
-
}
|
14
|
-
}
|
15
|
-
|
16
|
-
int32_t main() {
|
17
|
-
ios::sync_with_stdio(false);
|
18
|
-
cin.tie(0);
|
19
|
-
|
20
|
-
int n; cin >> n;
|
21
|
-
busy_loop();
|
22
|
-
|
23
|
-
vector<int> divisors;
|
24
|
-
for(int i = 1; i*i <= n; i++) {
|
25
|
-
if (n % i == 0) {
|
26
|
-
divisors.push_back(i);
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
sort(divisors.begin(), divisors.end());
|
31
|
-
for (int x : divisors) cout << x << '\n';
|
32
|
-
return 0;
|
33
|
-
}
|
rbx/testdata/box1/tle.sol.cpp
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
#include <bits/stdc++.h>
|
2
|
-
#include <ctime>
|
3
|
-
|
4
|
-
using namespace std;
|
5
|
-
|
6
|
-
void busy_loop() {
|
7
|
-
double wait = 1.0;
|
8
|
-
int start = clock();
|
9
|
-
int end = clock();
|
10
|
-
while (((double) (end - start)) / CLOCKS_PER_SEC < wait)
|
11
|
-
{
|
12
|
-
end = clock();
|
13
|
-
}
|
14
|
-
}
|
15
|
-
|
16
|
-
int32_t main() {
|
17
|
-
ios::sync_with_stdio(false);
|
18
|
-
cin.tie(0);
|
19
|
-
|
20
|
-
int n; cin >> n;
|
21
|
-
|
22
|
-
busy_loop();
|
23
|
-
|
24
|
-
vector<int> divisors;
|
25
|
-
for(int i = 1; i*i <= n; i++) {
|
26
|
-
if (n % i == 0) {
|
27
|
-
divisors.push_back(i);
|
28
|
-
if (i != n/i) divisors.push_back(n/i);
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
sort(divisors.begin(), divisors.end());
|
33
|
-
for (int x : divisors) cout << x << '\n';
|
34
|
-
return 0;
|
35
|
-
}
|
rbx/testdata/box1/validator.cpp
DELETED
rbx/testdata/box1/wa.sol.cpp
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
#include <bits/stdc++.h>
|
2
|
-
|
3
|
-
using namespace std;
|
4
|
-
|
5
|
-
int32_t main() {
|
6
|
-
ios::sync_with_stdio(false);
|
7
|
-
cin.tie(0);
|
8
|
-
|
9
|
-
int n; cin >> n;
|
10
|
-
|
11
|
-
vector<int> divisors;
|
12
|
-
for(int i = 1; i*i <= n; i++) {
|
13
|
-
if (n % i == 0) {
|
14
|
-
divisors.push_back(i);
|
15
|
-
divisors.push_back(n/i);
|
16
|
-
}
|
17
|
-
}
|
18
|
-
|
19
|
-
sort(divisors.begin(), divisors.end());
|
20
|
-
for (int x : divisors) cout << x << '\n';
|
21
|
-
return 0;
|
22
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
print(42)
|
rbx/testdata/compatible
DELETED
File without changes
|
@@ -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
|
-
}
|
rbx/testdata/interactive/gen.cpp
DELETED
@@ -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
|
-
}
|