Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <bits/stdc++.h>
- using namespace std;
- int c[10001];
- int main()
- {
- long long aj[10001],k=1,n,j,nr,m;
- c[1]=1;
- cin>>n;
- for(int i=1; i<=50; i++) {
- if(c[i]==0) {
- aj[k]=i;
- k++;
- for(j=i+i; j<=50; j+=i) {
- c[j]=1;
- }
- }
- }
- for(int i=1; i<=n; i++) {
- cin >> nr;
- j=1;
- int ok=0;
- for(int p=1;p<=k-1 && p<=n;p++)
- {
- m=((pow(2,aj[p]-1))*(pow(2,aj[p])-1));
- if(m==nr)
- ok=1;
- }
- if(ok==1)
- cout<<1<<" ";
- else
- cout<<0<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement