fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4.  
  5. int main()
  6. {
  7. int n, a, b;
  8. cin>>n>>a>>b;
  9. int s[n+2]={}, x[a+1], y[b+1];
  10. for(int i=0;i<a;i++)
  11. {
  12. cin>>x[i];
  13. s[x[i]]=1;
  14. }
  15. for(int i=0;i<b;i++)
  16. {
  17. cin>>y[i];
  18. if(s[y[i]]==0) s[y[i]]=2;
  19. }
  20. for(int i=1;i<=n;i++)
  21. {
  22. cout<<s[i]<<" ";
  23. }
  24. cout<<endl;
  25. }
Compilation error #stdin compilation error #stdout 0.01s 5472KB
stdin
4 2 3
1 2
2 3 4
compilation info
prog.cpp:9:11: error: variable-sized object may not be initialized
    int s[n+2]={}, x[a+1], y[b+1];
          ^~~
1 error generated.
stdout
Standard output is empty