当前位置:网站首页>hdu 1870 愚人节的礼物 (栈)
hdu 1870 愚人节的礼物 (栈)
2022-08-05 11:02:00 【51CTO】
愚人节的礼物
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 6260 Accepted Submission(s): 3788
Problem Description
四月一日快到了,Vayko想了个愚人的好办法——送礼物。嘿嘿,不要想的太好,这礼物可没那么简单,Vayko为了愚人,准备了一堆盒子,其中有一个盒子里面装了礼物。盒子里面可以再放零个或者多个盒子。假设放礼物的盒子里不再放其他盒子。
用()表示一个盒子,B表示礼物,Vayko想让你帮她算出愚人指数,即最少需要拆多少个盒子才能拿到礼物。
Input
本题目包含多组测试,请处理到文件结束。
每组测试包含一个长度不大于1000,只包含'(',')'和'B'三种字符的字符串,代表Vayko设计的礼物透视图。
你可以假设,每个透视图画的都是合法的。
Output
对于每组测试,请在一行里面输出愚人指数。
Sample Input
((((B)()))()) (B)
Sample Output
4 1
Author
Kiki
Source
不是栈的方法
栈的方法
边栏推荐
- The fuse: OAuth 2.0 four authorized login methods must read
- gradle尚硅谷笔记
- Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)
- uniapp中的view高度设置100%
- What are the standards for electrical engineering
- Student Information Management System (first time...)
- 【心里效应】98 个著名的心理效应
- 【AGC】增长服务1-远程配置示例
- How OpenHarmony Query Device Type
- 学生信息管理系统(第一次.....)
猜你喜欢
Scaling-law和模型结构的关系:不是所有的结构放大后都能保持最好性能
012年通过修补_sss_提高扩散模型效率
sqlserver编写通用脚本实现获取一年前日期的方法
Naive bayes
5G NR 系统消息
电气工程的标准是什么
Use KUSTO query statement (KQL) to query LOG on Azure Data Explorer Database
《分布式云最佳实践》分论坛,8 月 11 日深圳见
数据可视化(二)
Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)
随机推荐
【AGC】增长服务1-远程配置示例
sqlserver编写通用脚本实现获取一年前日期的方法
The fuse: OAuth 2.0 four authorized login methods must read
5G NR 系统消息
双因子与多因子身份验证有什么区别?
R语言使用yardstick包的pr_curve函数评估多分类(Multiclass)模型的性能、查看模型在多分类每个分类上的ROC曲线(precision(精准率),R代表的是recall(召回率)
记2022年七夕感慨
How OpenHarmony Query Device Type
[Translation] Chaos Net + SkyWalking: Better observability for chaos engineering
Android 开发用 Kotlin 编程语言一 基本数据类型
智能算力的枢纽如何构建?中国云都的淮海智算中心打了个样
Oracle的自动段空间管理怎么关闭?
Chapter 5: Activiti process shunting judgment, judging to go to different task nodes
This notebook of concurrent programming knowledge points strongly recommended by Ali will be a breakthrough for you to get an offer from a big factory
L2-042 老板的作息表
Guys, I am a novice. I use flinksql to write a simple count of user visits according to the document, but it ends after executing it once.
软件测试之集成测试
登录功能和退出功能(瑞吉外卖)
STM32 entry development: write XPT2046 resistive touch screen driver (analog SPI)
In-depth understanding of timeout settings for Istio traffic management