fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. long long int y = 1, cif = 1, putere = 1, n, x, r, v[65535];
  6.  
  7. int main()
  8. {
  9. cin >> n;
  10. for (int i = 1; i <= n; ++i) {
  11. cin >> x;
  12. cif = 1;
  13. putere = 1;
  14. while (cif + 1 < x) {
  15. ++putere;
  16. cif += putere;
  17. }
  18. if (cif + 1 == x)
  19. cout << 1 << ' ';
  20. else
  21. cout << 0 << ' ';
  22. }
  23. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty