Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///1209. 1, 10, 100, 1000...
- #include <iostream> ///Antonelli Alen Gabriel, E.E.S.T.N°5 MERLO, 5to 3ra
- #include <algorithm>
- #include <vector>
- using namespace std;
- int main ()
- {///2147483647
- int n;
- cin>>n;
- vector <unsigned long> p (65537, 0), k (n, 0);
- for (long i=1; i<p.size(); i++)
- p[i]=p[i-1]+i;
- for (int i=0; i<n; i++)
- cin>>k[i];
- cout<<endl;
- for (int i=0; i<n; i++)
- {
- if ( binary_search(p.begin(), p.end(), k[i]-1) )
- cout<<"1 ";
- else
- cout<<"0 ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment