Teams (uva11609+ combination)

Source: Internet
Author: User

I- TeamsTime limit:MS Memory Limit:0KB 64bit IO format:< /c7>%lld &%llu SubmitStatusPractice UVA 11609

Test Instructions: There are n individuals, choose more people to participate in the competition, one of them is the captain, the captain different from other players also counted as different programs. Ask you how many kinds of programs there are altogether. idea: Oneself only a little reasoning on paper, n*2 n-1%mod; Reprint Please specify the Source:Looking for Children & stars Topic Links:UVA 11609 Also welcome to me to open the topic brush question. Haha http://acm.hust.edu.cn/vjudge/contest/view.action?cid=77956#overview

#include <stdio.h> #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;}


Teams (uva11609+ combination)

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.