Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Pbinfo - #4708
- /// Formula : n * 2^(n-1)
- #include <fstream>
- using namespace std;
- ifstream cin("subsets.in");
- ofstream cout("subsets.out");
- struct nrMare{
- int a[10000] = {0};
- void operator = (int n)
- {
- do {a[++a[0]] = n%10, n/=10;} while(n);
- }
- void operator *= (int x)
- {
- int t = 0;
- for(int i = 1;i<=a[0];i++,t/=10)
- t+=a[i]*x, a[i] = t%10;
- while(t>0) a[++a[0]] = t%10, t/=10;
- }
- void afisare()
- {
- for(int i = a[0];i>0;i--)
- cout<<a[i];
- }
- };
- int main()
- {
- int n, p = 0; cin>>n;
- nrMare sol;
- sol = n;
- while(p+10<=n-1)
- sol*=(1<<10),p+=10;
- while(p+1<=n-1)
- sol*=2,p++;
- sol.afisare();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement