https://codeforces.com/contest/1139/problem/A

题解:末尾是偶数就是偶数

/*
*@Author:   STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int M=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q;
int ans,cnt,flag,temp,sum;
int a[N];
char str[N];
struct node{};
int main()
{
#ifdef DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout);
#endif//ios::sync_with_stdio(false);//cin.tie(0);//cout.tie(0);//scanf("%d",&t);//while(t--){scanf("%d%s",&n,str);for(int i=0;i<n;i++){if((str[i]-'0')%2==0){ans+=i+1;}}cout<<ans<<endl;//}#ifdef DEBUGprintf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
#endif//cout << "Hello world!" << endl;return 0;
}

Even Substrings相关推荐

  1. LeetCode刷题记录6——696. Count Binary Substrings(easy)

    LeetCode刷题记录6--696. Count Binary Substrings(easy) 目录 LeetCode刷题记录6--696. Count Binary Substrings(eas ...

  2. hihocoder 1152 Lucky Substrings

    #1152 : Lucky Substrings 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 A string s is LUCKY if and only if t ...

  3. [NC13C]形态形成场/[Gym100430B]Divisible Substrings

    [NC13C]形态形成场/[Gym100430B]Divisible Substrings 题目大意: 有\(m(m\le26)\)个字符串替换式\(S_i(|S_i\le100|)\),表示某个大写 ...

  4. Lucky Substrings

    而在26以内且属于fibonacci数列的数为1,2,3,5,8,13,21时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 A string s is LUCKY if ...

  5. A. Many Equal Substrings(自己很水)

    A. Many Equal Substrings You are given a string tt consisting of nn lowercase Latin letters and an i ...

  6. spoj 8222 Substrings (后缀自动机)

    spoj 8222 Substrings 题意:给一个字符串S,令F(x)表示S的所有长度为x的子串中,出现次数的最大值.求F(1)..F(Length(S)) 解题思路:我们构造S的SAM,那么对于 ...

  7. 647. Palindromic Substrings

    题目描述: Given a string, your task is to count how many palindromic substrings in this string. The subs ...

  8. leetcode 467. Unique Substrings in Wraparound String | 467. 环绕字符串中唯一的子字符串(动态规划)

    题目 https://leetcode.com/problems/unique-substrings-in-wraparound-string/ 题解 1.dp 超时版本 class Solution ...

  9. Codeforces Round #548 (Div. 2) A. Even Substrings

    You are given a string ?=?1?2-??s=s1s2-sn of length ?n, which only contains digits 11, 22, ..., 99. ...

  10. POJ - 3415 Common Substrings(长度不小于K的公共子串个数)

    Common Substrings 后缀数组+单调栈 题解1 题解2 题解3 #include<cstdio> #include<cstring> #include<io ...

最新文章

  1. Springboot源码分析之内嵌tomcat源码分析
  2. Nginx 真实的 IP
  3. 解决pycharm问题:module ‘pip‘ has no attribute ‘main‘
  4. 从零打造聚合支付系统:一、浅谈聚合支付的核心价值
  5. 最大似然估计(最大可能性估计)(likelihood)
  6. 初探GNN-文本表示学习
  7. [云炬创业基础笔记]第一章创业环境测试11
  8. 计算机系统崩溃重新装机,当计算机系统崩溃时如何用U盘重新安装Win7系统
  9. 终于找到了:NuGet 修改包路径
  10. 5个小技巧让你写出更好的JavaScript 条件语句
  11. 工程管理 -- makefile
  12. linux下echo /dev/ttys* 到字符设备文件,Linux系统的终端特殊设备文件
  13. JavaScript:自封装函数利用内置Date对象输出格式化“YYYY-MM-dd hh:mm:ss”时间
  14. 配置Outlook连接Exchange
  15. 阶段1 语言基础+高级_1-3-Java语言高级_06-File类与IO流_08 转换流_2_编码引出的问题_FileReader读取GBK格式文件...
  16. 并发编程学习之CopyOnWriteArraySet
  17. 微型计算机结构五大,微型计算机的体系结构
  18. 1.一个模型,帮你找到真正热爱的工作
  19. java判断小数位数_java-使用BigDecimal确定小数位数
  20. 快递查询单号查询,对物流进行分析

热门文章

  1. 跨sql server查询mysql_SQL Server 跨数据库查询数据的方法
  2. python super
  3. LCD LED OLED QLED区别
  4. 三星r750美版刷Android,这是才是全面派 三星space monitor详解
  5. vue中headers是什么_【vue】饿了么项目-header组件开发
  6. sql查询两个表结果相减_SQL 操作结果集 -并集、差集、交集、结果集排序
  7. 不需要配置的python编辑器_不用调就能用的小白Python编辑器有哪些?
  8. python小课笔记_python第三课笔记
  9. Oracle查找包共用,oracle – 用于查找包的多级依赖关系的脚本
  10. HDU1599 find the mincost route Floyd算法求最小环