Teams (uva11609 + combination)
I-TeamsTime Limit:1000 MSMemory Limit:0 KB64bit IO Format:% Lld & % lluSubmit Status Practice ultraviolet A 11609
Question: There are n people, and multiple people are selected to participate in the competition. One of them is the Team Leader. Different team leaders and other contestants are considered as different solutions ,. How many solutions are there for you. Train of Thought: I just had a slight reasoning on the paper, n * 2n-1% mod; reprinted please indicate the source: Search for the topic link of the child in the star light sector: I am also welcome to refer to the topic Q & A 11609. Haha http://acm.hust.edu.cn/vjudge/contest/view.action? Cid = 77956 # overview
# Include
# Define mod 1000000007 # define LL long longLL ppow (LL x, LL n) {LL tp = 1; while (n) {if (n & 1) tp = tp * x % mod; n >>= 1; x = x * x % mod;} return tp;} int main () {int ca = 1, T; scanf ("% d", & T); LL n; while (ca <= T) {scanf ("% lld", & n ); printf ("Case # % d: % lld \ n", ca ++, (n * ppow (2, n-1) % mod) ;}return 0 ;}