fork(28) download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. long long n, m, t, a[3000001], k;
  7.  
  8.  
  9. int main()
  10.  
  11. {
  12. scanf("%d%d", &n, &m);
  13. if (n - 1 <= m && m <= 2*(n + 1))
  14. {
  15. if (m == n - 1) {
  16. a[0] = -1;
  17. a[m + 1] = -1;
  18. t = n - 1;
  19. }
  20. else if (m == n)
  21. {
  22. a[m + 1] = -1;
  23. t = n;
  24. }
  25. else t = n + 1;
  26. k = m % t;
  27. if (k == 0 && m != t) k = n + 1;
  28. if (a[0] == -1) cout<<"0";
  29. for (int i = 1; i <= n; i++)
  30. {
  31. if (a[i] != -1){
  32. if (k > 0) cout<<"110";
  33. else cout<<"10";
  34. k--;
  35. }
  36. }
  37. if (a[m + 1] != -1) {
  38. if (k > 0) cout<<"11"<<endl;
  39. else cout<<"1"<<endl;
  40. }
  41. }
  42. else cout<<"-1"<<endl;
  43. }
Runtime error #stdin #stdout 0s 26736KB
stdin
Standard input is empty
stdout
Standard output is empty