首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
RingoCrystal
2025年3月14日 10:59
Problem E 题解:稍微复杂的括号匹配
P1425
回复 0
|
赞 0
|
浏览 122
#include <bits/stdc++.h> using namespace std; map<char,char> mp={ {'(',')'},{'[',']'},{'{','}'} }; int main(){ int n; while(cin>>n){ while(n--){ string s;cin>>s; stack<char>st; bool flag=true;...
My_opt
2022年4月26日 19:12
c++
P1425
回复 0
|
赞 0
|
浏览 3.8k
#include <iostream> #include <stack> #include <unordered_map> using namespace std; int n; string op; stack<char> stk; unordered_map<char, int> h = {{'{', 1}, {'[', 2}, {'(', 3}, {'}', -1}, {']', -2}, {')', -3}}; int main() { cin >> ...
tongzeliang
2022年4月24日 15:38
写的稍微有点复杂了...主要是stack的应用
P1425
回复 0
|
赞 1
|
浏览 4.5k
#include<iostream> #include<stack> #include<vector> #include<string> using namespace std; string judgestring(string str) { stack<char>stk; int len = str.length(); for (int i = 0; i < len; i++) &n...
JohnWang
2021年3月24日 18:35
括号匹配(无优先级)参考做法
P1425
回复 0
|
赞 0
|
浏览 7.5k
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; while(n--) { string s; cin >> s; int len = s.length(); stack<char> st; for(int i = 0;i < len;i++) { if(!st.empty())...
题目
Problem E
题解数量
4
发布题解
在线答疑
热门题解
1
写的稍微有点复杂了...主要是stack的应用
2
c++
3
Problem E 题解:稍微复杂的括号匹配
4
括号匹配(无优先级)参考做法