tasks_generator 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/ext/tasks_generator/variants.h +8 -2
- data/lib/tasks_generator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmVhZTkyZDAxMTFjMDYzMTExNzAwM2FiMmZiNzc0ZmFhZTQ2ZmZhMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDNiNTZhYTQ5MDk3NmVjOTMzMTM1NmRiOWVmNDViNWI4ZGNhN2JmYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzRhYzJiMGI3MzEwNTJiOTBiZjMwY2FiOGE1ZmNmMTMxMzczMDcyYWJhZmU4
|
10
|
+
MmFlNzk3ZGQ3OTc0ZjNkMzgyYWMwMDhkYTFkZTQyZDhmZWU5MWI1YTI4OWEw
|
11
|
+
OGMwMDQ5Y2E4N2RjNjI3ZTg3NDUwZWI3MDMxZmViMGFlZDM5MGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjJhNzQ1NjczYTBjNWIzOTk0NTVlYjliNDQzNGFhMjA1Yzc1ZTM2MjIyNGQz
|
14
|
+
MDM3NGJiZGVmM2U5ZDBjNzM1Y2Q1N2E3YTI1YTRmNjJiZTYxMDY4MmYyMzE2
|
15
|
+
YTlhNzVlODc0M2Y4NWQ2MjMzOWU4MzVmY2Q4Mjk3NjdhMjcxYTQ=
|
@@ -135,7 +135,13 @@ class variants_t {
|
|
135
135
|
size_t count = 1;
|
136
136
|
for (size_t j = 1; j < questions[i].size(); ++j)
|
137
137
|
count += buffer[j] != buffer[j - 1];
|
138
|
-
|
138
|
+
struct pair {
|
139
|
+
size_t first;
|
140
|
+
size_t second;
|
141
|
+
};
|
142
|
+
pair counter[count];
|
143
|
+
for (size_t i = 0; i < count; ++i)
|
144
|
+
counter[i].first = counter[i].second = 0;
|
139
145
|
ssize_t k = -1;
|
140
146
|
for (size_t j = 0; j < questions[i].size(); ++j) {
|
141
147
|
if (k == -1 || buffer[j] != counter[k].first) {
|
@@ -144,7 +150,7 @@ class variants_t {
|
|
144
150
|
}
|
145
151
|
++counter[k].second;
|
146
152
|
}
|
147
|
-
std::sort(counter, counter + count, [] (
|
153
|
+
std::sort(counter, counter + count, [] (pair const &a, pair const &b) -> bool {
|
148
154
|
return a.second > b.second;
|
149
155
|
});
|
150
156
|
double x = 0;
|