见:https://blog.csdn.net/dormousenone/article/details/75208903

 #define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#include <cstdio>//sprintf islower isupper
#include <cstdlib>//malloc exit strcat itoa system("cls")
#include <iostream>//pair
#include <fstream>//freopen("C:\\Users\\13606\\Desktop\\草稿.txt","r",stdin);
#include <bitset>
//#include <map>
//#include<unordered_map>
#include <vector>
#include <stack>
#include <set>
#include <string.h>//strstr substr
#include <string>
#include <time.h>//srand(((unsigned)time(NULL))); Seed n=rand()%10 - 0~9;
#include <cmath>
#include <deque>
#include <queue>//priority_queue<int, vector<int>, greater<int> > q;//less
#include <vector>//emplace_back
//#include <math.h>
//#include <windows.h>//reverse(a,a+len);// ~ ! ~ ! floor
#include <algorithm>//sort + unique : sz=unique(b+1,b+n+1)-(b+1);+nth_element(first, nth, last, compare)
using namespace std;//next_permutation(a+1,a+1+n);//prev_permutation
#define fo(a,b,c) for(register int a=b;a<=c;++a)
#define fr(a,b,c) for(register int a=b;a>=c;--a)
#define mem(a,b) memset(a,b,sizeof(a))
#define pr printf
#define sc scanf
#define ls rt<<1
#define rs rt<<1|1
typedef long long ll;
#define rint register int;
void swapp(int &a,int &b);
double fabss(double a);
int maxx(int a,int b);
int minn(int a,int b);
int Del_bit_1(int n);
int lowbit(int n);
int abss(int a);
//const long long INF=(1LL<<60);
const double E=2.718281828;
const double PI=acos(-1.0);
const int inf=(<<);
const double ESP=1e-;
const int mod=(int)1e9+;
const int N=(int)1e6+; ll ans[];
char s[N];
ll get(int l)
{
ll sum=;
for(int i=;i<=l;++i)
sum*=,sum+=s[i]-'';
return sum;
} int main()
{
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
ans[]=;
while(~sc("%s",s+))
{
int l=strlen(s+);
if(l>)
pr("83 1111111110\n");
else
{
ll t=get(l);
for(int i=;i<=;++i)
{
if(i==||t<ans[i+])
{
pr("%d %lld\n",i,ans[i]);
break;
}
}
}
}
return ;
} /**************************************************************************************/ int maxx(int a,int b)
{
return a>b?a:b;
} void swapp(int &a,int &b)
{
a^=b^=a^=b;
} int lowbit(int n)
{
return n&(-n);
} int Del_bit_1(int n)
{
return n&(n-);
} int abss(int a)
{
return a>?a:-a;
} double fabss(double a)
{
return a>?a:-a;
} int minn(int a,int b)
{
return a<b?a:b;
}

1-N(1的总数)找规律的更多相关文章

  1. LightOJ 13361336 - Sigma Function (找规律 + 唯一分解定理)

    http://lightoj.com/volume_showproblem.php?problem=1336 Sigma Function Time Limit:2000MS     Memory L ...

  2. HDU 3032 (SG打表找规律)

    题意: 有n堆石子,alice先取,每次可以选择拿走一堆石子中的1~x(该堆石子总数) ,也可以选择将这堆石子分成任意的两堆.alice与bob轮流取,取走最后一个石子的人胜利. 思路: 因为数的范围 ...

  3. hdu 2604 Queuing dp找规律 然后矩阵快速幂。坑!!

    http://acm.hdu.edu.cn/showproblem.php?pid=2604 这题居然O(9 * L)的dp过不了,TLE,  更重要的是找出规律后,O(n)递推也过不了,TLE,一定 ...

  4. 找规律/贪心 Codeforces Round #310 (Div. 2) A. Case of the Zeros and Ones

    题目传送门 /* 找规律/贪心:ans = n - 01匹配的总数,水 */ #include <cstdio> #include <iostream> #include &l ...

  5. hdu 3951 - Coin Game(找规律)

    这道题是有规律的博弈题目,,, 所以我们只需要找出规律来就ok了 牛人用sg函数暴力找规律,菜鸟手工模拟以求规律...[牢骚] if(m>=2) { if(n<=m) {first第一口就 ...

  6. HDU 5703 Desert 水题 找规律

    已知有n个单位的水,问有几种方式把这些水喝完,每天至少喝1个单位的水,而且每天喝的水的单位为整数.看上去挺复杂要跑循环,但其实上,列举几种情况之后就会发现是找规律的题了= =都是2的n-1次方,而且这 ...

  7. hdu4952 Number Transformation (找规律)

    2014多校 第八题 1008 2014 Multi-University Training Contest 8 4952 Number Transformation Number Transform ...

  8. CF456B Fedya and Maths 找规律

    http://codeforces.com/contest/456/problem/B CF#260 div2 B Fedya and Maths Codeforces Round #260 B. F ...

  9. hdu 4731 2013成都赛区网络赛 找规律

    题意:找字串中最长回文串的最小值的串 m=2的时候暴力打表找规律,打表可以用二进制枚举

  10. 找规律 Codeforces Round #290 (Div. 2) A. Fox And Snake

    题目传送门 /* 水题 找规律输出 */ #include <cstdio> #include <iostream> #include <cstring> #inc ...

随机推荐

  1. CaoHaha's staff (HDU 6154)(2017中国大学生程序设计竞赛 - 网络选拔赛)

    Problem Description "You shall not pass!" After shouted out that,the Force Staff appered i ...

  2. 数据结构实验之求二叉树后序遍历和层次遍历(SDUT 2137)

    Problem Description 已知一棵二叉树的前序遍历和中序遍历,求二叉树的后序遍历和层序遍历. Input 输入数据有多组,第一行是一个整数t (t<1000),代表有t组测试数据. ...

  3. 内置对象 Date

    1.内置对象     a)语言自带的对象     b)提供了常用的,基本的功能     Date 1.定义的方法          a) 获取当前时间 var date1=new Date(); co ...

  4. elasticsearch+logstash+kibana部署

    这篇博客讲的是elasticsearch+logstash+kibana部署的方法. 内容大纲: 1.elasticsearch+logstash+kibana部署 2.收集Tomcat日志 3.收集 ...

  5. java调用exe,及调用bat不成功的解决办法

    开门见山的说,文件目录如下 想调用123.exe,但是尝试了几次调用不到,然后写了个bat.初始内容如下 @echo off D: cd test "123.exe" 双击可以运行 ...

  6. SpringCloud(四)之Netflix开源组件断路器Hystrix介绍

    一.前言? 1.Netflix Hystrix断路器是什么? Netflix Hystrix是SOA/微服务架构中提供服务隔离.熔断.降级机制的工具/框架.Netflix Hystrix是断路器的一种 ...

  7. Nginx优化之基本安全优化 (隐藏Nginx软件版本号信息,更改源码隐藏Nginx软件名及版本号,更改Nginx服务的默认用户)

    一,隐藏Nginx软件版本号信息 查看版本号 curl -I 192.168.0.220 HTTP/1.1 200 OK Server: nginx/1.6.2 #这里清晰的暴露了Web版本号(1.6 ...

  8. acl设置问题

    在学习nfs服务配置的时候用到了acl规则(服务配置文件权限设置可写,但是由于客户端映射,不能写入,所以要设置系统权限),但是遇到了一个小小的问题:一.当使用-x选项取消规则的时候,再次查看权限后面仍 ...

  9. MACBOOK 破解wifi密码

    MACBOOK 破解wifi密码 Table of Contents 1. 安装homebrew 2. 安装aircrack-ng 3. 获取wifi网卡信息 4. 获取所有可识别的wifi信息 5. ...

  10. HashMap ArrayList 和 List对象的转换

    public static void main(String[] args) { List list = new ArrayList<>(); HashMap map = new Hash ...