Codeforces Round #233 (Div. 2) B. Red and Blue Balls
#include <iostream>
#include <string> using namespace std; int main(){
int n;
cin >> n;
string str;
cin >> str;
long long cnt = , x = ;
for(int i = ; i < n ; ++ i){
if(str[i] == 'B') cnt+=(x << i);
}
cout<<cnt<<endl;
}
| Codeforces Round #233 (Div. 2) |
|---|
Codeforces Round #233 (Div. 2) B. Red and Blue Balls的更多相关文章
- Codeforces Round #233 (Div. 2) A、Pages
#include <iostream> using namespace std; int main(){ int n,p,k; cin >> n >> p > ...
- Codeforces Round #233 (Div. 2)D. Painting The Wall 概率DP
D. Painting The Wall ...
- Codeforces Round #309 (Div. 2) C. Kyoya and Colored Balls 排列组合
C. Kyoya and Colored Balls Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contes ...
- Codeforces Round #309 (Div. 2) C. Kyoya and Colored Balls
Kyoya Ootori has a bag with n colored balls that are colored with k different colors. The colors are ...
- Codeforces Round #446 (Div. 2)
Codeforces Round #446 (Div. 2) 总体:rating涨了好多,虽然有部分是靠和一些大佬(例如redbag和ShichengXiao)交流的--希望下次能自己做出来2333 ...
- Codeforces Round #485 (Div. 2)
Codeforces Round #485 (Div. 2) https://codeforces.com/contest/987 A #include<bits/stdc++.h> us ...
- Codeforces Round #485 (Div. 2) A. Infinity Gauntlet
Codeforces Round #485 (Div. 2) A. Infinity Gauntlet 题目连接: http://codeforces.com/contest/987/problem/ ...
- Codeforces Round #545 (Div. 1) 简要题解
这里没有翻译 Codeforces Round #545 (Div. 1) T1 对于每行每列分别离散化,求出大于这个位置的数字的个数即可. # include <bits/stdc++.h&g ...
- Codeforces Round 536 (Div. 2) (E)
layout: post title: Codeforces Round 536 (Div. 2) author: "luowentaoaa" catalog: true tags ...
随机推荐
- 图结构练习——最短路径(floyd算法(弗洛伊德))
图结构练习——最短路径 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 给定一个带权无向图,求节点1到节点n的最短路径. 输 ...
- Storyboards
这里是吐槽时间,换掉了mac默认的输入法,出发点只有一个,就是切换中英文输入的时候相当不爽.也许是习惯了其他各大输入法的一键切换,而又没有找到自带输入法可设置的地方. Segue 以前我们使用navi ...
- PHP商品秒杀计时实现(解决大流量方案)
PHP商品秒杀功能我们多半以整点或时间点为例子,这样对于php来说处理不复杂,但有一个问题就是如果流量大要如何来处理,下面我们一起来看看解决办法. 要求要有小时分钟秒的实时倒计时的显示,用户端修改日期 ...
- HR外包系统 - 薪资项目分类
序号 薪资项目编码规则 6到9开头1 普通工资项目加项 7开头三位,7XX,不够时,从71XX开始2 普通工资项目减项 8开头三位,8XX,不够时,从81XX开始3 ...
- C++ 中 char 与 int 转换问题
itoa 功 能:把一整数转换为字符串 函 数:char *itoa(int value, char *string, int radix); 解 释:itoa 是英文integer to ar ...
- [荐] jQuery取得select选择的文本与值
csdn:http://blog.csdn.net/tiemufeng1122/article/details/44154571 jquery获取select选择的文本与值获取select :获取se ...
- Java中的wait和sleep
sleep()和wait() 首先,Java中的多线程是一种抢占式的机制,而不是分时机制.抢占式的机制是有多个线程处于可运行状态,但是只有一个线程在运行. 这种机制决定了,对于同一对象的多线程访问,必 ...
- orientation和gravity的区别
orientation:决定UI组件是按行还是列显示 gravity:指定文字对齐方式.
- Android学习笔记(一)——安卓开发环境搭建
安装教程以及资源(2015.11.8最新版):链接:http://pan.baidu.com/s/1kTnOsMr 密码:0ogf
- 封装用className选元素
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...