fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7. int N,K,Q;
  8. cin>>N>>K>>Q;
  9. vector<int> vec(N,K);
  10. int ansp;
  11. for(int i=0; i<Q; i++){
  12. cin>>ansp;
  13. ansp=ansp-1;
  14. vec[ansp]+=1;
  15. }
  16. vector<int> v=vec.sort(vec.begin(),vec.end());
  17. //int *max=v.end();
  18. for(int i=0; i<N; i++){
  19. if(v[N-1]-vec[i]>=0) cout<<"Yes"<<endl;
  20. else cout<<"No"<<endl;
  21. }
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
6 3 4
3
1
3
2
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16:19: error: ‘class std::vector<int>’ has no member named ‘sort’
 vector<int> v=vec.sort(vec.begin(),vec.end());
                   ^~~~
stdout
Standard output is empty