zoukankan      html  css  js  c++  java
  • Codeforces Parking Lot

    http://codeforces.com/problemset/problem/630/I

    简单的排列组合,推式子技巧:举一个小样例,看着推,别抽象着推,容易错

    #include <iostream>
    #include <cstdio>
    #include <queue>
    #include <algorithm>
    #include <cmath>
    #include <cstring>
    #define inf 2147483647
    #define N 1000010
    #define p(a) putchar(a)
    #define For(i,a,b) for(long long i=a;i<=b;++i)
    
    using namespace std;
    long long n;
    void in(long long &x){
        long long y=1;char c=getchar();x=0;
        while(c<'0'||c>'9'){if(c=='-')y=-1;c=getchar();}
        while(c<='9'&&c>='0'){ x=(x<<1)+(x<<3)+c-'0';c=getchar();}
        x*=y;
    }
    void o(long long x){
        if(x<0){p('-');x=-x;}
        if(x>9)o(x/10);
        p(x%10+'0');
    }
    
    long long ksm(long long a,long long b){
        long long r=1;
        while(b>0){
            if(b&1)
                r=r*a;
            a=a*a;
            b>>=1;
        }
        return r;
    }
    
    int main(){
        in(n);
        o((9*n-3)*ksm(4,n-3));
        return 0;
    }
  • 相关阅读:
    mysql-数据库增删改查
    判断,循环
    数组
    html 三种垂直居中
    箭头函数
    Array类型
    object
    JAVA WEB 行业技术
    一个好的程序员
    经典语录
  • 原文地址:https://www.cnblogs.com/war1111/p/11289809.html
Copyright © 2011-2022 走看看