artemgf

1.10.100.1000.10000....

Mar 21st, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <math.h>
  4. #include <string>
  5. #include <algorithm>
  6. #include <set>
  7.  
  8. using namespace ::std;
  9.  
  10. int main()
  11. {
  12.     unsigned long long N, d = 0, j = 1, max = -1;
  13.     unsigned long long arr[65536];
  14.     set <unsigned long long> number1;
  15.     double n, prom1 = 1, prom2;
  16.  
  17.     cin >> N;
  18.     for (unsigned long long i = 1; i <= N; i++)
  19.     {
  20.         cin >> arr[i];
  21.         if (arr[i]> max)
  22.             max = arr[i];
  23.     }
  24.  
  25.     for (unsigned long long i = 1; i <= N; i++)
  26.     {
  27.         if (arr[i] != 1)
  28.             if ((1 / 4) - 2 + 2 * arr[i] >= 0)
  29.             {
  30.                 prom1 = sqrt((1.0 / 4.0) - 2.0 + 2.0 * arr[i]) - (1.0 / 2.0);
  31.                 if (prom1 > 0 && prom1 - (int)prom1 == 0)
  32.                     cout << "1 ";
  33.                 else
  34.                     cout << "0 ";
  35.             }
  36.             else
  37.                 cout << "0 ";
  38.         else
  39.             cout << "1 ";
  40.     }
  41.  
  42.     _getch();
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment