fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. long K[500001],P[200001];
  4. int N,Q;
  5. int ans[200001];
  6. int main() {
  7. cin>>N>>Q;
  8. for(int q=0;q<N;q=q+1){
  9. cin>>K[q];
  10. }
  11. for(int q=0;q<Q;q=q+1){
  12. cin>>P[q];
  13. }
  14. for(int w=0;w<Q;w=w+1){
  15. for(int q=0;q<N;q=q+1){
  16. if(P[w]>K[q]){
  17. ans[w]+=1;
  18. }
  19. }
  20. }
  21. for(int q=0;q<Q;q=q+1){
  22. cout<<ans[q]%2<<"\n";
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
Standard output is empty