【HDOJ5949】Relative atomic mass(签到)
题意:给定一个只由H、C、O三种分子组成物质的分子式,求相对分子质量
len<=10
思路:队友写的
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string.h>
#include <limits.h>
#include <string>
#include <iostream>
#include <queue>
#include <math.h>
#include <stack>
#include <map>
#define left (now<<1)
#define right ((now<<1)+1)
#define mid ((l+r)>>1)
using namespace std;
typedef long long int lint; int n,t;
const int MAXN = 1e5 + ; char str[MAXN]; int main(){
scanf("%d",&t);
while(t--){
scanf("%s",str); int len = strlen(str); lint ans = ;
for(int i = ; i < len; ++i){
if(str[i] == 'H'){
++ans;
}else if(str[i] == 'C'){
ans += ;
}else{
ans += ;
}
}
printf("%I64d\n",ans);
}
return ;
}
【HDOJ5949】Relative atomic mass(签到)的更多相关文章
- HDU 5949 Relative atomic mass 【模拟】 (2016ACM/ICPC亚洲区沈阳站)
Relative atomic mass Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Oth ...
- Relative atomic mass
Relative atomic mass Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Oth ...
- 2016ACM/ICPC亚洲区沈阳站 - A/B/C/E/G/H/I - (Undone)
链接:传送门 A - Thickest Burger - [签到水题] ACM ICPC is launching a thick burger. The thickness (or the heig ...
- 2016 ACM/ICPC亚洲区沈阳站
A B C D E F G H I J K L M O O O $\varnothing$ $\varnothing$ $\varnothing$ $\varnothing$ $\varnothi ...
- 2016ACM/ICPC亚洲区沈阳站-重现赛赛题
今天做的沈阳站重现赛,自己还是太水,只做出两道签到题,另外两道看懂题意了,但是也没能做出来. 1. Thickest Burger Time Limit: 2000/1000 MS (Java/Oth ...
- ACM Shenyang Onsite 2016 题目
A. Thickest Burger 1000ms 262144K ACM ICPC is launching a thick burger. The thickness (or the heig ...
- 2016ACM/ICPC亚洲区沈阳站 Solution
A - Thickest Burger 水. #include <bits/stdc++.h> using namespace std; int t; int a, b; int main ...
- The 2016 ACM-ICPC Asia Shenyang Regional Contest
A. Thickest Burger 大数 × 2 + 小数 #include <cstdio> #include <algorithm> using namespace st ...
- absurd, abundant
absurd How: absolutely, completely, clearly, faintly, manifestly, obviously, patently, quite, rather ...
随机推荐
- APPScan-简单操作流程
图解安全扫描工具 AppScan使用 IBM Rational AppScan 是一个面向 Web 应用安全检测的自动化工具,使用它可以自动化检测 Web 应用的安全漏洞. 比如跨站点脚本攻击(C ...
- python:lambda、filter、map、reduce
lambda 为关键字.filter,map,reduce为内置函数. lambda:实现python中单行最小函数. g = lambda x: x * 2 #相当于 def g(x): retur ...
- CPP-基础:String类
已知类String的原型为: class String { public: String(const char *str = NULL); // 普通构造函数 String(const String ...
- HTML5基础知识习题 一
1. HTML5 之前的 HTML 版本是什么? 答: HTML 4.01 2. HTML5 的正确 doctype 是? 答: <!DOCTYPE html> 3. 在 HTML5 中, ...
- NSLayoutConstraint.constraintsWithVisualFormat详解,以及AlignAllCenterY
NSLayoutConstraint.constraintsWithVisualFormat详解,以及AlignAllCenterY 转载2015-07-08 18:02:02 鉴于苹果官方文档的解释 ...
- mysql 备份解密脚本
#!/bin/bash #by sk 备份解码脚本 echo "-------------------------------------------------" functio ...
- 【Python学习之二】装饰器
装饰器 首先,给出装饰器的框架: def log(func): def wrapper(*args, **kw): print('call %s():' % func.__name__) return ...
- 编译openwrt_MT7688_hiwooya
参考链接: 无涯论坛地址: http://www.hi-wooya.com/forum.php openwrt官网地址:https://openwrt.org/zh-cn/doc/howto/buil ...
- 【php】 布尔值判断
当转换为 boolean 时,以下值被认为是 FALSE: 布尔值 FALSE 本身 整型值 0(零) 浮点型值 0.0(零) 空字符串,以及字符串 "0" 不包括任何元素的数组 ...
- 细说unittest-2
一.unittest模块官方文档: https://docs.python.org/3/library/unittest.html 二.一张图看懂unittest: 三.Unittest主要方法属性: ...