Skip to content

Commit 196f126

Browse files
committed
another one
1 parent 5eef2d6 commit 196f126

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/data_structures/uncommon/mode_query.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const int b = 318; //!< sqrt(1e5)
44
struct mode_query {
55
int n;
66
vi a, cnt, index_into_index;
7-
vector<vi> index;
7+
vector<basic_string<int>> index;
88
vector<vector<pii>>
99
mode_blocks; //!< {mode, cnt} of range of blocks
1010
//! @param a compressed array: 0 <= a[i] < n
@@ -16,7 +16,7 @@ struct mode_query {
1616
vector<pii>((n + b - 1) / b)) {
1717
rep(i, 0, n) {
1818
index_into_index[i] = sz(index[a[i]]);
19-
index[a[i]].push_back(i);
19+
index[a[i]] += i;
2020
}
2121
for (int start = 0; start < n; start += b) {
2222
int mode = a[start];

0 commit comments

Comments
 (0)