Educational Codeforces Round 8 B. New Skateboard
题目链接:http://codeforces.com/problemset/problem/628/B
解题思路:
一个数最后两位数能被4整除那么这个数就能被4整除,而且题目还是连续的子序列,这就很简单了
实现代码:
#include <cstdio>
#include <string>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <bitset>
using namespace std;
#define ll long long
int main()
{
ll ans = ,i,j,num,k;
string s;
cin>>s;
int len = s.size();
for(i=;i<len;i++){
num = s[i]-'';
if(num%==)
ans++;
}
//cout<<ans<<endl;
if(len>=){
for(i=;i<len-;i++){
num = (s[i] - '')*+(s[i+]-'');
if(num%==)
ans++;
}
}
//cout<<ans<<endl;
if(len>=){
for(i=;i<len-;i++){
num = (s[i] - '')*+(s[i+]-'');
if(num%==){
ans+=i;
}
//cout<<ans<<endl;
}
}
cout<<ans<<endl;
}
Educational Codeforces Round 8 B. New Skateboard的更多相关文章
- Educational Codeforces Round 8 B. New Skateboard 暴力
B. New Skateboard 题目连接: http://www.codeforces.com/contest/628/problem/A Description Max wants to buy ...
- [Educational Codeforces Round 16]E. Generate a String
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...
- [Educational Codeforces Round 16]D. Two Arithmetic Progressions
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...
- [Educational Codeforces Round 16]C. Magic Odd Square
[Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...
- [Educational Codeforces Round 16]B. Optimal Point on a Line
[Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line wi ...
- [Educational Codeforces Round 16]A. King Moves
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...
- Educational Codeforces Round 6 C. Pearls in a Row
Educational Codeforces Round 6 C. Pearls in a Row 题意:一个3e5范围的序列:要你分成最多数量的子序列,其中子序列必须是只有两个数相同, 其余的数只能 ...
- Educational Codeforces Round 9
Educational Codeforces Round 9 Longest Subsequence 题目描述:给出一个序列,从中抽出若干个数,使它们的公倍数小于等于\(m\),问最多能抽出多少个数, ...
- Educational Codeforces Round 37
Educational Codeforces Round 37 这场有点炸,题目比较水,但只做了3题QAQ.还是实力不够啊! 写下题解算了--(写的比较粗糙,细节或者bug可以私聊2333) A. W ...
随机推荐
- IDEA Junit4配置
一.安装JUnitGenerator V2.0. 1.通过网络安装.如下 2.手动下载插件安装.插件下载:https://plugins.jetbrains.com/idea/plugin/3064- ...
- Java的运算符--与(&)、非(~)、或(|)、异或(^)详解
一.计算机中存储的都是补码 java也是如此: System.out.println(Integer.toBinaryString(2)); System.out.println(Integer.to ...
- 验证码处理类:UnCodebase.cs + BauDuAi 读取验证码的值(并非好的解决方案)
主要功能:变灰,去噪,等提高清晰度等 代码类博客,无需多说,如下: public class UnCodebase { public Bitmap bmpobj; public UnCodebase( ...
- RabbitMQ在特来电的深度应用
特来电是一个互联网公司,而且是技术领先的互联网公司.互联网公司的标配是什么?答案就是缓存+MQ.没错,您没看错,就是MQ--消息队列,我们今天要讨论的RabbitMQ就是消息队列中功能非常强大的一种. ...
- Mvc_缓存浅谈
缓存是将信息放在内存中以避免频繁访问数据库从数据库中提取数据,在系统优化过程中,缓存是比较普遍的优化做法和见效比较快的做法. 对于MVC有Control缓存和Action缓存. 一.Control缓存 ...
- CSS文本实例
CSS 文本属性可定义文本的外观. 通过文本属性,您可以改变文本的颜色.字符间距,对齐文本,装饰文本,对文本进行缩进,等等.#############################CSS 文本属性属 ...
- Visual Studio的安装与单元测试
一.Visual Studio的安装 由于上学期重装了win10系统,以前使用的vc++6.0不能够正常使用,所以直接就安装了Visual Studio 2015,安装的时候就直接按照提示的步骤进行安 ...
- M2 终审
1.团队成员简介 左边:马腾跃 右边:陈谋 左上:李剑锋 左下:仉伯龙 右:卢惠明 团队成员及博客: 李剑锋: Blog: http://www.cnblogs.com/Po ...
- github 学习心得
https://github.com/kongxiangyu/test 通过本次实验,学会了如何使用github来管理代码.如果是开源的项目,通过网站托管方式进行统一管理,当然是非常棒的,并且有很多功 ...
- 第三个Sprint冲刺第二天(燃尽图)