C. Without Text

题目连接:

http://www.codeforces.com/contest/656/problem/C

Description

You can preview the image in better quality by the link: http://assets.codeforces.com/files/656/without-text.png

Input

The only line of the input is a string (between 1 and 50 characters long, inclusive). Each character will be an alphanumeric character or a full stop ".".

Output

Output the required answer.

Sample Input

Codeforces

Sample Output

-87

Hint

题意

给你一个信号系统,然后问你输出是啥

题解:

还好我专业课是信号与系统,没事儿干就看这种图片……

模拟模拟就好了

代码

#include<bits/stdc++.h>
using namespace std; string s;
int id(char c)
{
if(c>='A'&&c<='Z')return c-'A'+1;
if(c>='a'&&c<='z')return c-'a'+1;
}
int main()
{
long long res = 0;
cin>>s;
for(int i=0;i<s.size();i++)
{
char a1 = '@';
char a2 = '[';
char a3 = '`';
char a4 = '{';
int flag1 = (a1<s[i])&(a2>s[i]);
int flag2 = (a3<s[i])&(a4>s[i]);
res = res + (flag1*id(s[i]))-(flag2*id(s[i]));
}
cout<<res<<endl;
}

April Fools Day Contest 2016 C. Without Text 信号与系统的更多相关文章

  1. April Fools Day Contest 2016 D. Rosetta Problem

    D. Rosetta Problem 题目连接: http://www.codeforces.com/contest/656/problem/D Description ++++++++[>+& ...

  2. April Fools Day Contest 2016 G. You're a Professional

    G. You're a Professional 题目连接: http://www.codeforces.com/contest/656/problem/G Description A simple ...

  3. April Fools Day Contest 2016 F. Ace It!

    F. Ace It! 题目连接: http://www.codeforces.com/contest/656/problem/F Description Input The only line of ...

  4. April Fools Day Contest 2016 E. Out of Controls

    E. Out of Controls 题目连接: http://www.codeforces.com/contest/656/problem/E Description You are given a ...

  5. April Fools Day Contest 2016 B. Scrambled

    B. Scrambled 题目连接: http://www.codeforces.com/contest/656/problem/B Description Btoh yuo adn yuor roo ...

  6. April Fools Day Contest 2016 A. Da Vinci Powers

    A. Da Vinci Powers 题目连接: http://www.codeforces.com/contest/656/problem/A Description The input conta ...

  7. CF #April Fools Day Contest 2016 E Out of Controls

    题目连接:http://codeforces.com/problemset/problem/656/E 愚人节专场的E,整个其实就是个Floyd算法,但是要求代码中不能包含 definedoforfo ...

  8. April Fools Day Contest 2014

    April Fools Day Contest 2014 A.C.H三道题目 ============================================================= ...

  9. 坑爹CF April Fools Day Contest题解

    H - A + B Strikes Back A + B is often used as an example of the easiest problem possible to show som ...

随机推荐

  1. AUC画图与计算

    利用sklearn画AUC曲线 from sklearn.metrics import roc_curve labels=[1,1,0,0,1] preds=[0.8,0.7,0.3,0.6,0.5] ...

  2. 36 - 网络编程-TCP编程

    目录 1 概述 2 TCP/IP协议基础 3 TCP编程 3.1 通信流程 3.2 构建服务端 3.3 构建客户端 3.4 常用方法 3.4.1 makefile方法 3.5 socket交互 3.4 ...

  3. Redis 启动警告解决【转】

    [root@centos224]# service redisd start :M Nov :: (it was originally set to ). _._ _.-``__ ''-._ _.-` ...

  4. [MySQL] gap lock/next-key lock浅析

    当InnoDB在判断行锁是否冲突的时候, 除了最基本的IS/IX/S/X锁的冲突判断意外, InnoDB还将锁细分为如下几种子类型: record lock (RK) 记录锁, 仅仅锁住索引记录的一行 ...

  5. 网页查看源码中&lt;div&gt的含义

    代码如下: /** HTML转义 **/ String s = HtmlUtils.htmlEscape("<div>hello world</div><p&g ...

  6. 推荐一个数据相关的网站tushare

    推荐一个网站:tushare 使用方法如下: pip install tushare 我是使用pycharm直接安装的 抓取了浦发和光大的股票数据,并通过csv进行保存,和通过plt进行图片打印 im ...

  7. 以太坊go-ethereum客户端JSON-RPC API调用(一)

    前几篇博客主要介绍了go-ethereum客户端不同环境的搭建,今天这篇博客是建立在前几排博客的基础上.当搭建完成之后,我们可以通过各种方式与节点进行交互(JavaScript Console.JSO ...

  8. 解决类似 /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found 的问题

    https://itbilu.com/linux/management/NymXRUieg.html

  9. Redis 启动与授权

    启动 Redis $redis-server 检查Redis是否在工作? $redis-cli 这将打开一个Redis提示,如下图所示: redis 127.0.0.1:6379> 上面的提示1 ...

  10. 快速开发window服务器程序

    import service; service.startDispatchThread( 服务名 = function(serviceName,argv){ import service; var s ...