zoukankan      html  css  js  c++  java
  • bzoj 1192

    http://www.lydsy.com/JudgeOnline/problem.php?id=1192

    好像学过一个东西:

    [0..2^(N+1)-1]内的数都的都可以由2^0,2^1,...,2^N这N+1个数中若干个相加得到。

    #include<cstdio>
    #include<cstdlib>
    #include<iostream>
    #include<fstream>
    #include<algorithm>
    #include<cstring>
    #include<string>
    #include<cmath>
    #include<queue>
    #include<stack>
    #include<map>
    #include<utility>
    #include<set>
    #include<bitset>
    #include<vector>
    #include<functional>
    #include<deque>
    #include<cctype>
    #include<climits>
    #include<complex>
    //#include<bits/stdc++.h>适用于CF,UOJ,但不适用于poj
     
    using namespace std;
    
    typedef long long LL;
    typedef double DB;
    typedef pair<int,int> PII;
    typedef complex<DB> CP;
    
    #define mmst(a,v) memset(a,v,sizeof(a))
    #define mmcy(a,b) memcpy(a,b,sizeof(a))
    #define fill(a,l,r,v) fill(a+l,a+r+1,v)
    #define re(i,a,b)  for(i=(a);i<=(b);i++)
    #define red(i,a,b) for(i=(a);i>=(b);i--)
    #define ire(i,x) for(typedef(x.begin()) i=x.begin();i!=x.end();i++)
    #define fi first
    #define se second
    #define m_p(a,b) make_pair(a,b)
    #define SF scanf
    #define PF printf
    #define two(k) (1<<(k))
    
    template<class T>inline T sqr(T x){return x*x;}
    template<class T>inline void upmin(T &t,T tmp){if(t>tmp)t=tmp;}
    template<class T>inline void upmax(T &t,T tmp){if(t<tmp)t=tmp;}
    
    const DB EPS=1e-9;
    inline int sgn(DB x){if(abs(x)<EPS)return 0;return(x>0)?1:-1;}
    const DB Pi=acos(-1.0);
    
    inline int gint()
      {
            int res=0;bool neg=0;char z;
            for(z=getchar();z!=EOF && z!='-' && !isdigit(z);z=getchar());
            if(z==EOF)return 0;
            if(z=='-'){neg=1;z=getchar();}
            for(;z!=EOF && isdigit(z);res=res*10+z-'0',z=getchar());
            return (neg)?-res:res; 
        }
    inline LL gll()
      {
          LL res=0;bool neg=0;char z;
            for(z=getchar();z!=EOF && z!='-' && !isdigit(z);z=getchar());
            if(z==EOF)return 0;
            if(z=='-'){neg=1;z=getchar();}
            for(;z!=EOF && isdigit(z);res=res*10+z-'0',z=getchar());
            return (neg)?-res:res; 
        }
    
    int m,cnt,p;
    
    int main()
      {
          freopen("bzoj1192.in","r",stdin);
            freopen("bzoj1192.out","w",stdout);
            m=gint();
            cnt=0;p=2;
            while(p-1<m)p<<=1,cnt++;
            PF("%d
    ",cnt+1);
            return 0;
        }
    View Code
  • 相关阅读:
    SQL常用单词
    Appium+python自动化获取toast消息的方法
    转:TCP/IP协议(一)网络基础知识
    【转】使用python实现appium的屏幕滑动
    JMETER java.net.SocketTimeoutException: Read timed out
    JMETER java.net.SocketException: Connection reset 报错解决方案
    Jmeter Distributed (Remote) Testing: Master Slave Configuration
    转:Jmeter分布式测试
    转:centos查看实时网络带宽占用情况方法
    Python类继承(转发)
  • 原文地址:https://www.cnblogs.com/maijing/p/4747594.html
Copyright © 2011-2022 走看看