Teams (uva11609 + combination)

Source: Internet
Author: User

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 ;}

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.