Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ll N = 1 << n;
- for (ll i = 0, t=0, s = 0, ros=1; i < N; i++)
- {
- for (ll j = 0; j < n; j++)
- {
- if (i & (1 << j))
- {
- if (s!=0) s *= ros;
- s += m[j];
- t++;
- }
- }
- if (i != 0)
- {
- st[i - 1].first = s;
- st[i - 1].second = t;
- }
- t = 0;
- s = 0;
- ros = 10;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement