当前位置:网站首页>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
不是栈的方法
栈的方法
边栏推荐
- 用KUSTO查询语句(KQL)在Azure Data Explorer Database上查询LOG实战
- nyoj86 找球号(一) set容器和二分 两种解法
- Chapter 4: In the activiti process, variable transmission and acquisition process variables, setting and acquiring multiple process variables, setting and acquiring local process variables "recommende
- 如何用Golang来手写一个Blog - Milu.blog 开发总结
- uniapp中的view高度设置100%
- 365天挑战LeetCode1000题——Day 050 在二叉树中增加一行 二叉树
- MMDetection in action: MMDetection training and testing
- PostgreSQL 2022 报告:流行度上涨,开源、可靠性和扩展是关键
- 2022 Hangzhou Electric Power Multi-School Session 6 1008.Shinobu Loves Segment Tree Regular Questions
- 自定义过滤器和拦截器实现ThreadLocal线程封闭
猜你喜欢
随机推荐
FPGA: Basic Getting Started LED Lights Blinking
OpenHarmony如何查询设备类型
四、kubeadm单master
GPU-CUDA-图形渲染分析
What do T and Z in the time format 2020-01-13T16:00:00.000Z represent and how to deal with them
用户考试分数大于单科科目平均分的查询
What are the standards for electrical engineering
The fuse: OAuth 2.0 four authorized login methods must read
Android development with Kotlin programming language - basic data types
苹果Meta都在冲的Pancake技术,中国VR团队YVR竟抢先交出产品答卷
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.
智能算力的枢纽如何构建?中国云都的淮海智算中心打了个样
TiDB 6.0 Placement Rules In SQL Usage Practice
012年通过修补_sss_提高扩散模型效率
Chapter 4: activiti RuntimeService settings get and get process variables, and the difference from taskService, set process variables when starting and completing tasks [easy to understand]
Go compilation principle series 6 (type checking)
nyoj754 黑心医生 结构体优先队列
Chapter 5: Activiti process shunting judgment, judging to go to different task nodes
机器学习——逻辑回归
How to choose coins and determine the corresponding strategy research









