220 DIV2 B. Inna and Nine
220 DIV2 B. Inna and Nine
input
369727
output
2
input
123456789987654321
output
1
题意:比如例子1:369727-->99727-->9997 , 369727-->99727-->9979
14545181例子2:14545181-->1945181-->194519-->19919,
14545181-->1945181-->199181-->19991
但是:14545181-->149591这是错的
注意:使用__int64
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#define M 100005
char s[M]; int main()
{
//freopen("in.txt","r",stdin);
while(~scanf("%s",s))
{
int i,n;
n=strlen(s);
__int64 ans=;
for(i=;i<n;i++)
{
if(s[i]-''+s[i+]-''== && i+<n)
{
__int64 c=;
while(s[i]-''+s[i+]-''==)
{
c++;
i++;
}
if(c%==)
ans*=;
else
ans*=(c/+);
}
}
printf("%I64d\n",ans);
}
return ;
}
220 DIV2 B. Inna and Nine的更多相关文章
- 220 DIV2 A. Inna and Pink Pony
Inna and Pink Pony 输入n,m,i,j,a,b 可以看成n行m列的矩阵,起点(i,j),每次移动(a,b),(-a,-b),(-a,b),(a,-b) 可移动到(1,m),(n,1) ...
- codeforces round #234B(DIV2) C Inna and Huge Candy Matrix
#include <iostream> #include <vector> #include <algorithm> #include <utility> ...
- codeforces round #234B(DIV2) A Inna and Choose Options
#include <iostream> #include <string> #include <vector> using namespace std; ; ,,, ...
- codeforces round #234B(DIV2) B Inna and New Matrix of Candies
#include <iostream> #include <vector> #include <string> #include <algorithm> ...
- Codeforce Round #220 Div2
这场气场太大,居然一个题不会! 所以没交! 赛后发现 A:陷阱多- -!不要超过上下界,可以上去再下来! B:不会做! C:自己想太多- -!
- Codeforce 220 div2
D 插入: 在当前指针位置sz处插入一个1,col[sz]记录插入的内容,sz++; 删除i: 找到第i个1的位置,赋为0; 于是转化为一个维护区间和的问题; trick: 如果是依次删除a[0],a ...
- CodeForces比赛总结表
Codeforces A B C D ...
- codeforces div2 220 解题
这套题我只写了a, b, c.. 对不起,是我太菜了. A:思路:就是直接简化为一个矩阵按照特定的步骤从一个顶角走到与之对应的对角线上的顶角.如图所示. 解释一下特定的步骤,就像马走日,象走田一样. ...
- Codeforces Round #220 (Div. 2) D - Inna and Sequence
D - Inna and Sequence 线段数维护区间有几个没有被删除的数,利用线段树的二分找第几个数在哪里,然后模拟更新就好啦. #include<bits/stdc++.h> #d ...
随机推荐
- NSS_09 gridpanel中的actioncolumn事件
在设计角色权限时, 终于用到了grid的actioncolumn,如下: { header: '权限设定', xtype: 'actioncolumn', items: [{ icon: 'Conte ...
- Lucene 4.0
关于4.0的Update Index ,Create Index /* * Create Index */ public static void createIndex() throws IOExc ...
- jquery 在页面中三种写法
jQuery 分 2 个系列版本 1.x 与 2.x,主要的区别在于 2.x 不再兼容 IE6.7.8浏览器,这样做的目的是为了兼容移动端开发.由于减少了一些代码,使得该版本比 jQuery 1.x ...
- Laravel 5 基础(二)- 路由、控制器和视图简介
查看 app/Http/routes.php Route::get('/', 'WelcomeController@index'); @是一个界定符,前面是控制器,后面是动作,表示当用户请求url / ...
- RaddioButton控件
<GroupBox Margin="5"> <StackPanel> <RadioButton IsChecked="true"& ...
- Redis 二:入门基本篇
.多数据库设置 - ,代表16个数据库 .glob风格通配符 keys * 返回所有 keys ba? 返回 bar keys b[a-z][a-z] 返回btt bar \x 匹配转义字符 .判断一 ...
- Go学习指南
学习Golang书籍&资料: 1. The Go Programming Language Specification: http://golang.org/ref/spec 2. How ...
- nginx学习之一
http://tengine.taobao.org/book/chapter_02.html
- C# 实现Oracle中的数据与Excel之间的转换
最近项目要求实现数据库之间数据在各个数据库之间导入导出,在此做个笔记 1. 将Oracle中的表导入到Excel中,反之亦然 private static readonly string conne ...
- POJ 3801 有上下界最小流
1: /** 2: POJ 3801 有上下界的最小流 3: 4: 1.对supersrc到supersink 求一次最大流,记为f1.(在有源汇的情况下,先使整个网络趋向必须边尽量满足的情况) 5: ...