https://nanti.jisuanke.com/t/43375

简单的二进制变换

  可以理解为当前二进制数 自增1 到2^(n-1)需要的操作数

  注意输出格式

代码

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<deque>
#include<iomanip>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include <vector>
#include <iterator>
#include <utility>
#include <sstream>
#include <limits>
#include <numeric>
#include <functional>
using namespace std;
#define gc getchar()
#define mem(a) memset(a,0,sizeof(a))
//#define sort(a,n,int) sort(a,a+n,less<int>()) #define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef char ch;
typedef double db; const double PI=acos(-1.0);
const double eps=1e-6;
const ll mod=1e9+7;
const int inf=0x3f3f3f3f;
const int maxn=1e5+10;
const int maxm=100+10; bool compare(int a, int b)
{
return a < b;//升序
} int main(){
int t = 0;
char c;
cin >> t;
unsigned long long num = 1;
for(int i = 0;i<t-1;i++)
{
num*=2;
}
unsigned long long sum = 0;
while(t--)
{
cin >>c;
if(c == 'O')
{
sum+=num;
}
num /=2;
}
cout<<sum;
return 0;
}

  

H. Zebras and Ocelots -ICPC North Central NA Contest 2017的更多相关文章

  1. ICPC North Central NA Contest 2018

    目录 ICPC North Central NA Contest 2018 1. 题目分析 2. 题解 A.Pokegene B.Maximum Subarrays C.Rational Ratio ...

  2. Bumped! 2017 ICPC North American Qualifier Contest (分层建图+dijstra)

    题目描述 Peter returned from the recently held ACM ICPC World finals only to find that his return flight ...

  3. 2018-2019 ICPC, NEERC, Southern Subregional Contest

    目录 2018-2019 ICPC, NEERC, Southern Subregional Contest (Codeforces 1070) A.Find a Number(BFS) C.Clou ...

  4. Codeforces 2018-2019 ICPC, NEERC, Southern Subregional Contest

    2018-2019 ICPC, NEERC, Southern Subregional Contest 闲谈: 被操哥和男神带飞的一场ACM,第一把做了这么多题,荣幸成为7题队,虽然比赛的时候频频出锅 ...

  5. 2019-2020 ICPC, Asia Jakarta Regional Contest (Online Mirror, ICPC Rules, Teams Preferred)

    2019-2020 ICPC, Asia Jakarta Regional Contest (Online Mirror, ICPC Rules, Teams Preferred) easy: ACE ...

  6. 2018 ICPC Pacific Northwest Regional Contest I-Inversions 题解

    题目链接: 2018 ICPC Pacific Northwest Regional Contest - I-Inversions 题意 给出一个长度为\(n\)的序列,其中的数字介于0-k之间,为0 ...

  7. The North American Invitational Programming Contest 2017 题目

    NAIPC 2017 Yin and Yang Stones 75.39% 1000ms 262144K   A mysterious circular arrangement of black st ...

  8. 组队练习赛(Regionals 2012, North America - East Central NA)

    A.Babs' Box Boutique 给定n个盒子,每个盒子都有长宽高(任意两个盒子长宽高不完全相同),现在选盒子的任意两面,要求x1 <= x2 && y1 <= y ...

  9. 130825组队赛-Regionals 2012, North America - East Central NA

    A.Babs' Box Boutique 一道简单的dfs搜索题,需要两两比较,然后搜到底,得到最大值就行了.比赛时队友写的,我只负责debug..赛后自己写的.. #include<iostr ...

  10. Gym-101673 :East Central North America Regional Contest (ECNA 2017)(寒假自训第8场)

    A .Abstract Art 题意:求多个多边形的面积并. 思路:模板题. #include<bits/stdc++.h> using namespace std; typedef lo ...

随机推荐

  1. OAuth2密码模式:信任的甜蜜陷阱与安全指南

    title: OAuth2密码模式:信任的甜蜜陷阱与安全指南 date: 2025/05/29 14:56:19 updated: 2025/05/29 14:56:19 author: cmdrag ...

  2. SAP UI类标准导出XML格式Excel

    DATA: gt_fieldcatalog TYPE lvc_t_fcat, gs_fieldcatalog TYPE lvc_s_fcat, lr_data TYPE REF TO data, r_ ...

  3. 两步实现让antd与IDE和睦相处的处理案例

    导读: Web IDE的开发从来是整个大数据平台开发中非常繁复和笨重的一环,从零搭建一个 Web IDE 通常意味着大量的殚精竭虑和苦思冥想,时间成本更是不可计数.两个UI组件库一起用更是bug的代名 ...

  4. Java学习篇(三)—— 集合框架

    集合框架是什么? 对容器的学习建议结合leecode,了解每一个容器的增删改查操作. 数据结构里学习了几种数据结构类型:数组.链表.栈.队列.树.哈希表.堆.在C++中,C++ STL提供了数组vec ...

  5. sql注入绕过某waf

    简单布尔判断 直接输入and 1=1拦截 使用mysql黑魔法 and{a 1=1} and{a 1=2}不拦截 本地mysql测试语句正常执行 简单延时判断 and sleep(1) 简单测试后在( ...

  6. java--Struts框架基础

    基于mvc模式的应用框架之struts Struts就是基于mvc模式的框架! (struts其实也是servlet封装,提高开发效率!) Struts开发步骤: 1. web项目,引入struts ...

  7. vite+vue3/react使用tailwindcss

    vite+vue3/react使用 1.通过 npm 安装 Tailwind npm install -D tailwindcss postcss autoprefixer 2.创建您的配置文件 np ...

  8. LNK1107 文件无效或损坏: 无法在 0x308 处读取 解决方案

    LNK1107 文件无效或损坏: 无法在 0x308 处读取 解决方案 环境:windows 需要的库 freeglut.dll 使用cmake编译的时候,有一个选项,选择编译器,如果你编译的是一个3 ...

  9. C++线程池 基于Cpp98的实现 学习2 未完待续

    简介 用到了太多的C++11的知识点,所以,暂时学点别的再搞这个. C++11 特殊函数的认识 delete defalut在C++11的作用可以参考这篇文章 https://blog.csdn.ne ...

  10. 解决EasyExcel读取日期为1905年

    问题 用EasyExcel导入Excel的时候读取日期出现问题,部分日期读取变成1905年 Excel中的日期格式比较特别,是yyyy.MM格式的,和数字类型的小数非常相似 和Excel中的日期对不上 ...