fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int i=0;
  6. int j=k-1;
  7. while(j<n){
  8. set <int> s;
  9. for(int m=i;m<=j;m++){
  10. s.insert(A[m]);
  11. }
  12. cout<<s.size()<<" ";
  13. i++;
  14. j++;
  15.  
  16. }
  17. printf("\n");
  18. return 0;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:6:11: error: ‘k’ was not declared in this scope
     int j=k-1;
           ^
prog.cpp:7:13: error: ‘n’ was not declared in this scope
     while(j<n){
             ^
prog.cpp:8:9: error: ‘set’ was not declared in this scope
         set <int> s;
         ^~~
prog.cpp:8:14: error: expected primary-expression before ‘int’
         set <int> s;
              ^~~
prog.cpp:10:13: error: ‘s’ was not declared in this scope
             s.insert(A[m]);
             ^
prog.cpp:10:22: error: ‘A’ was not declared in this scope
             s.insert(A[m]);
                      ^
prog.cpp:12:15: error: ‘s’ was not declared in this scope
         cout<<s.size()<<" ";
               ^
stdout
Standard output is empty