Language: C++

#include <bits/stdc++.h>
using namespase std;

void count(vector<int> p,int K,int n,int & count){
   vector<int> buffer(K);
   for(int i=0;i<K;i++) buffer(i) = p(n*K+i);
   
   for(int i=0;i<K-1;i++){
     if(buffer(i) > buffer(i+1)) count++; 
   }
}


int main(){
  int N,K;
  int count_all,count;
  count_all = 0;
  
  cin >> N >>K;
  
  vector<int> p(N);
  for(int i=0;i<N;i++) cin >> p.at(i);
  
  for(int i=0;i<N-K+1;i++){
   count=0;
   count(p, K, i,count);
   count_all = count_all + count;
  }
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
a.cc:4:6: error: variable or field 'count' declared void
    4 | void count(vector<int> p,int K,int n,int & count){
      |      ^~~~~
a.cc:4:12: error: 'vector' was not declared in this scope
    4 | void count(vector<int> p,int K,int n,int & count){
      |            ^~~~~~
a.cc:4:12: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:4:19: error: expected primary-expression before 'int'
    4 | void count(vector<int> p,int K,int n,int & count){
      |                   ^~~
a.cc:4:26: error: expected primary-expression before 'int'
    4 | void count(vector<int> p,int K,int n,int & count){
      |                          ^~~
a.cc:4:32: error: expected primary-expression before 'int'
    4 | void count(vector<int> p,int K,int n,int & count){
      |                                ^~~
a.cc:4:38: error: expected primary-expression before 'int'
    4 | void count(vector<int> p,int K,int n,int & count){
      |                                      ^~~
a.cc: In function 'int main()':
a.cc:19:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   19 |   cin >> N >>K;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:21:3: error: 'vector' was not declared in this scope
   21 |   vector<int> p(N);
      |   ^~~~~~
a.cc:21:3: note: suggested alternatives:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:21:10: error: expected primary-expression before 'int'
   21 |   vector<int> p(N);
      |          ^~~
a.cc:22:31: error: 'p' was not declared in this scope
   22 |   for(int i=0;i<N;i++) cin >> p.at(i);
      |                               ^
a.cc:26:10: error: 'p' was not declared in this scope
   26 |    count(p, K, i,count);
      |          ^
a.cc:26:9: error: 'count' cannot be used as a function
   26 |    count(p, K, i,count);
      |    ~~~~~^~~~~~~~~~~~~~~