当前位置:网站首页>Good simple recursive problem, string recursive training
Good simple recursive problem, string recursive training
2022-04-23 05:08:00 【FOWng_ lp】

Topic link
https://www.luogu.com.cn/problem/P1928
Click here
Code
Easy to understand code answer
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;
string dg(){
int cnt;
string s="",ss;
char c;
while(cin >> c){
if(c=='['){
cin >> cnt;
ss = dg();
while(cnt--)s+=ss;
}
else {
if(c==']')return s;
else s+=c;
}
}
}
int main(){
cout << dg();
return 0;
}
That's good !
版权声明
本文为[FOWng_ lp]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220549345804.html
边栏推荐
- Field injection is not recommended using @ Autowired
- Innovation training (XI) airline ticket crawling company information
- Details related to fingerprint payment
- Golang select priority execution
- One month countdown, pgconf What are the highlights of the latest outlook of asia2021 Asian Conference?
- HRegionServer的详解
- 和谐宿舍(线性dp / 区间dp)
- Deep learning notes - data expansion
- 【数据库】表的查看、修改和删除
- Summary of R & D technology
猜你喜欢

The 8 diagrams let you see the execution sequence of async / await and promise step by step

AQS源码阅读
![[database] MySQL multi table query (I)](/img/c7/43167aa6169c24a8d9734032775335.png)
[database] MySQL multi table query (I)
![[winui3] Écrivez une copie du gestionnaire de fichiers Explorer](/img/3e/62794f1939da7f36f7a4e9dbf0aa7a.png)
[winui3] Écrivez une copie du gestionnaire de fichiers Explorer

Use model load_ state_ Attributeerror appears when dict(): 'STR' object has no attribute 'copy‘
![[2021] Spatio-Temporal Graph Contrastive Learning](/img/7d/67a0bfa0adecee24bbe291a25ae906.png)
[2021] Spatio-Temporal Graph Contrastive Learning

Summary of MySQL knowledge points

深度学习笔记 —— 语义分割和数据集

深度学习笔记 —— 数据增广

What are the redis data types
随机推荐
Introduction to load balancing
负载均衡简介
What are instruction cycles, machine cycles, and clock cycles?
Golang memory escape
MySQL circularly adds sequence numbers according to the values of a column
Independent station operation | Facebook marketing artifact - chat robot manychat
【数据库】MySQL单表查询
MySQL uses or to query SQL, and SQL execution is very slow
Harmonious dormitory (linear DP / interval DP)
View, modify and delete [database] table
mysql5. 7. X data authorization leads to 1141
Sword finger offer: symmetric binary tree (recursive iteration leetcode 101)
Deep learning notes - object detection and dataset + anchor box
Luogu p2731 horse riding fence repair
Set Chrome browser background to eye protection (eye escort / darkreader plug-in)
Innovation training (II) task division
[2022 ICLR] Pyraformer: Low-Complexity Pyramidal Attention for Long-Range 时空序列建模和预测
js 判斷數字字符串中是否含有字符
TypeError: ‘Collection‘ object is not callable. If you meant to call the ......
Docker installation and mysql5 7 installation