April Fools Day Contest 2016 C. Without Text 信号与系统
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 信号与系统的更多相关文章
- April Fools Day Contest 2016 D. Rosetta Problem
D. Rosetta Problem 题目连接: http://www.codeforces.com/contest/656/problem/D Description ++++++++[>+& ...
- 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 ...
- 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 ...
- 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 ...
- April Fools Day Contest 2016 B. Scrambled
B. Scrambled 题目连接: http://www.codeforces.com/contest/656/problem/B Description Btoh yuo adn yuor roo ...
- 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 ...
- CF #April Fools Day Contest 2016 E Out of Controls
题目连接:http://codeforces.com/problemset/problem/656/E 愚人节专场的E,整个其实就是个Floyd算法,但是要求代码中不能包含 definedoforfo ...
- April Fools Day Contest 2014
April Fools Day Contest 2014 A.C.H三道题目 ============================================================= ...
- 坑爹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 ...
随机推荐
- pycharts实现可视化
https://blog.csdn.net/u012535605/article/details/80677791http://pyecharts.org/#/zh-cn/prepare (中文官网 ...
- Struts访问servletAPI方式
1.原理
- JSON与JS的区别以及转换
JSON是什么?(JSON和JavaScript对象有什么区别?)如何把JS对象转化为JSON字符串,又如何把JSON字符串转化为JavaScript对象? JSON (JavaScript Obje ...
- 看到了一篇博文,关于网卡的sniff模式,感觉相当好
@font-face { font-family: "Times New Roman"; }@font-face { font-family: "宋体"; }@ ...
- 巅峰极客CTF writeup[上]
经验教训 1.CTF不比实战,最好不要死磕.死磕就输了.我就是死磕在缓存文件死的.真的惭愧: 2.对于flag的位置不要太局限于web目录下,如果是命令执行直接上find / -name flag*: ...
- Linux下用到数据库sqlite3
最近在Linux下用到数据库sqlite3,于是开始了该方面的学习. 0. 引言 我们这篇文章主要讲述了如何在C/C++语言中调用 sqlite 的函数接口来实现对数据库的管理, 包括创建数据库.创建 ...
- 010 JVM类加载
转自http://www.importnew.com/23742.html 前言 我们知道我们写的程序经过编译后成为了.class文件,.class文件中描述了类的各种信息,最终都需要加载到虚拟机之后 ...
- windows安装React Native开发运行环境
React Native是什么 React Native是facebook开源的一个用于开发app的框架.React Native的设计理念:既拥有Native (原生) 的用户体验.又保留React ...
- ubuntu16.04 安装 python3.6, 并创建虚拟环境(使用python3.6)
ubuntu16.04 安装 python3.6, 并创建虚拟环境(使用python3.6) ubuntu16.04中默认安装了 python2.7 python3 python3.5.2 (注意 : ...
- [ python ] 面向对象 - 选课系统
根据源程序进行改写: 原程序地址:http://www.cnblogs.com/lianzhilei/p/5985333.html 如有侵权立即删除. 感谢原作者将完整的代码提供参考. ...