#line 1 "main.cpp" #include #ifdef DEBUG #include #else #define dump(...) ((void)0) #endif template bool chmin(T &a, const U &b){ return (a > b ? a = b, true : false); } template bool chmax(T &a, const U &b){ return (a < b ? a = b, true : false); } template void fill_array(T (&a)[N], const U &v){ std::fill((U*)a, (U*)(a + N), v); } template auto make_vector(const std::array &a, T value = T()){ static_assert(I >= 1); static_assert(N >= 1); if constexpr (I == 1){ return std::vector(a[N - I], value); }else{ return std::vector(a[N - I], make_vector(a, value)); } } template std::ostream& operator<<(std::ostream &s, const std::vector &a){ for(auto it = a.begin(); it != a.end(); ++it){ if(it != a.begin()) s << " "; s << *it; } return s; } template std::istream& operator>>(std::istream &s, std::vector &a){ for(auto &x : a) s >> x; return s; } std::string YesNo(bool value){return value ? "Yes" : "No";} std::string YESNO(bool value){return value ? "YES" : "NO";} std::string yesno(bool value){return value ? "yes" : "no";} template void putl(const T &value){ std::cout << value << "\n"; } template void putl(const Head head, const Tail &... tail){ std::cout << head << " "; putl(tail ...); } #line 6 "/home/haar/Downloads/kyopro-lib/Mylib/DataStructure/SegmentTree/segment_tree.cpp" namespace haar_lib { template class segment_tree { public: using value_type = typename Monoid::value_type; private: Monoid M_; int depth_, size_, hsize_; std::vector data_; public: segment_tree(){} segment_tree(int n): depth_(n > 1 ? 32 - __builtin_clz(n - 1) + 1 : 1), size_(1 << depth_), hsize_(size_ / 2), data_(size_, M_()) {} auto operator[](int i) const { assert(0 <= i and i < hsize_); return data_[hsize_ + i]; } auto fold(int l, int r) const { assert(0 <= l and l <= r and r <= hsize_); value_type ret_left = M_(); value_type ret_right = M_(); int L = l + hsize_, R = r + hsize_; while(L < R){ if(R & 1) ret_right = M_(data_[--R], ret_right); if(L & 1) ret_left = M_(ret_left, data_[L++]); L >>= 1, R >>= 1; } return M_(ret_left, ret_right); } auto fold_all() const { return data_[1]; } void set(int i, const value_type &x){ assert(0 <= i and i < hsize_); i += hsize_; data_[i] = x; while(i > 1) i >>= 1, data_[i] = M_(data_[i << 1 | 0], data_[i << 1 | 1]); } void update(int i, const value_type &x){ assert(0 <= i and i < hsize_); i += hsize_; data_[i] = M_(data_[i], x); while(i > 1) i >>= 1, data_[i] = M_(data_[i << 1 | 0], data_[i << 1 | 1]); } template void init_with_vector(const std::vector &val){ data_.assign(size_, M_()); for(int i = 0; i < (int)val.size(); ++i) data_[hsize_ + i] = val[i]; for(int i = hsize_; --i >= 1;) data_[i] = M_(data_[i << 1 | 0], data_[i << 1 | 1]); } template void init(const T &val){ init_with_vector(std::vector(hsize_, val)); } private: template int bound(const int l, const int r, value_type x, F f) const { std::vector pl, pr; int L = l + hsize_; int R = r + hsize_; while(L < R){ if(R & 1) pr.push_back(--R); if(L & 1) pl.push_back(L++); L >>= 1, R >>= 1; } std::reverse(pr.begin(), pr.end()); pl.insert(pl.end(), pr.begin(), pr.end()); value_type a = M_(); for(int i : pl){ auto b = M_(a, data_[i]); if((Lower and not f(b, x)) or (not Lower and f(x, b))){ while(i < hsize_){ const auto c = M_(a, data_[i << 1 | 0]); if((Lower and not f(c, x)) or (not Lower and f(x, c))){ i = i << 1 | 0; }else{ a = c; i = i << 1 | 1; } } return i - hsize_; } a = b; } return r; } public: template > int lower_bound(int l, int r, value_type x, F f = F()) const { return bound(l, r, x, f); } template > int upper_bound(int l, int r, value_type x, F f = F()) const { return bound(l, r, x, f); } }; } #line 2 "/home/haar/Downloads/kyopro-lib/Mylib/AlgebraicStructure/Monoid/bitor.cpp" namespace haar_lib { template struct bitor_monoid { using value_type = T; value_type operator()() const {return 0;} value_type operator()(value_type a, value_type b) const {return a | b;} }; } #line 5 "/home/haar/Downloads/kyopro-lib/Mylib/IO/join.cpp" namespace haar_lib { template std::string join(Iter first, Iter last, std::string delim = " "){ std::stringstream s; for(auto it = first; it != last; ++it){ if(it != first) s << delim; s << *it; } return s.str(); } } #line 69 "main.cpp" namespace haar_lib {} namespace solver { using namespace haar_lib; constexpr int m1000000007 = 1000000007; constexpr int m998244353 = 998244353; void init(){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(12); std::cerr << std::fixed << std::setprecision(12); std::cin.exceptions(std::ios_base::failbit); } void solve(){ int N, K; std::cin >> N >> K; std::string S; std::cin >> S; std::vector danger(N + 1); for(int i = 1; i <= N - 1; ++i){ danger[i] = S[i - 1] == 'x'; } danger[N] = true; dump(danger); segment_tree> seg(2 * N + 1); for(int i = N; i >= 0; --i){ if(danger[i]){ seg.set(i, false); }else{ bool r = seg.fold(i + 1, i + K + 1); seg.set(i, not r); } } for(int i = 1; i <= N; ++i){ std::cerr << (int)seg[i]; } std::cerr << "\n"; std::vector ans; for(int i = 1; i <= K; ++i){ if(seg[i]) ans.push_back(i); } if(ans.empty()){ std::cout << 0 << "\n"; }else{ std::cout << join(ans.begin(), ans.end()) << "\n"; } } } int main(){ solver::init(); while(true){ try{ solver::solve(); std::cout << std::flush; std::cerr << std::flush; }catch(const std::istream::failure &e){ break; }catch(...){ break; } } return 0; }