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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDA0NjJhMmY0YWEzY2VmYzA0M2Q1YjU0MzA4NTNhZWQwNjFiOWNiYg==
4
+ MmVhZTkyZDAxMTFjMDYzMTExNzAwM2FiMmZiNzc0ZmFhZTQ2ZmZhMg==
5
5
  data.tar.gz: !binary |-
6
- YmJiMTZhYTZlMjQyODk0YmI5ZjM0MmZlOWU2NjE5Y2ExZjM2ZjM5OQ==
6
+ ZDNiNTZhYTQ5MDk3NmVjOTMzMTM1NmRiOWVmNDViNWI4ZGNhN2JmYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTcyMDk2ZTg5ZTI4NTM3ZmI2ZWU2NzdlNDE3ZTMwNWFhZWI4MzhmNzA2NWU3
10
- YmY5ZmJjOTMxMjY5NjMzNWQyNzA3YWNlY2VmYzAxMjY5MTljYmIyMDhjNmMx
11
- OTc5N2NmY2ZiZTk0OTczNjIyNWJhNDAxNWM0OGZlZDZkOGRjY2I=
9
+ MzRhYzJiMGI3MzEwNTJiOTBiZjMwY2FiOGE1ZmNmMTMxMzczMDcyYWJhZmU4
10
+ MmFlNzk3ZGQ3OTc0ZjNkMzgyYWMwMDhkYTFkZTQyZDhmZWU5MWI1YTI4OWEw
11
+ OGMwMDQ5Y2E4N2RjNjI3ZTg3NDUwZWI3MDMxZmViMGFlZDM5MGY=
12
12
  data.tar.gz: !binary |-
13
- MzA4ODU4YzBmMDMzZWJhMWYzZWJmOThkNWYxYjQ5YjVhYmRjZWE5YjhhZjAx
14
- MDA4OWM1MDc3ZmYxNzFmYjIwNDY0ZjZkMjFlY2EyYWI2NDhiYzdlMTAwNGY1
15
- OWZlYTE5YTdhMzI2MGU3MGJiOGUyNThjNDYwODU4NTcxYTA0Nzc=
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
- std::pair<size_t, size_t> counter[count];
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, [] (std::pair<size_t, size_t> const &a, std::pair<size_t, size_t> const &b) -> bool {
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;
@@ -1,3 +1,3 @@
1
1
  module TasksGenerator
2
- VERSION = "1.0"
2
+ VERSION = "1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tasks_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arslan Urtashev