题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=423 Sample Input 3(A-B + C) - (A+(B - C)) - (C-(D- E) )((A)-( (B)))A-(B+C) Sample Output A-B+C-(A+B-C)-(C-(D-E))A-BA-(B+C) 题目大意:给出加减代数表达式,仅由变量(大写字母表示),圆括号,加号 '+', 减号'-'组成,要求去掉多余的括号,但是不能改…
Description You have typed the report of your term project in your personal computer. There are several one line arithmetic expressions in your report. There is no redundant parentheses in the expressions (omitting a pair of redundant matching parent…
(Your)((Term)((Project))) Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 3353 Accepted: 1256 Description You have typed the report of your term project in your personal computer. There are several one line arithmetic expressions in your r…
(Your)((Term)((Project))) Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2912   Accepted: 1084 Description You have typed the report of your term project in your personal computer. There are several one line arithmetic expressions in yo…
题目传送门 /* 题意:第i个人选择第a[i]个人,问组成强联通分量(自己连自己也算)外还有多少零散的人 有向图强联通分量-Tarjan算法:在模板上加一个num数组,记录每个连通分量的点数,若超过1,则将连通点数相加 用总点数-ans则是零散的点 详细解释:http://www.bubuko.com/infodetail-927304.html */ #include <cstdio> #include <cstring> #include <algorithm> #…
Term Project Time Limit: 3000ms Memory Limit: 131072KB This problem will be judged on UVALive. Original ID: 651164-bit integer IO format: %lld      Java class name: Main     解题:强连通分量  #include <bits/stdc++.h> using namespace std; ; struct arc{ int t…
这道题在LA是挂掉了,不过还好,zoj上也有这道题. 题意:好大一颗树,询问父子关系..考虑最坏的情况,30w层,2000w个点,询问100w次,貌似连dfs一遍都会TLE. 安心啦,这肯定是一道正常人能做的题目.不过是需要几个小技巧. 1.2000w个点不一定都要保存下来,事实上,虽然题目给了256M的空间,只要开了两个这么大的数组,MLE是跑不了的,所以只保存30w个父节点. 2.如果这30w个父节点构成一条链,dfs的栈肯定爆.所以需要用栈模拟dfs.这里用的是stack<int>,当然…
只有在 Month 和 Day 都为素数的时候才能得到糖 那就模拟一遍时间即可. //#pragma comment(linker, "/STACK:16777216") //for c++ Compiler #include <stdio.h> #include <iostream> #include <fstream> #include <cstring> #include <cmath> #include <sta…
- Total Amount Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 2476 Description Given a list of monetary amounts in a standard format, please calculate the total amount. We define the format as fo…
今天帮人写的第二篇课设 . ;-) 机智的窝 要求:大概说一下吧,就是要创建一个用户(初始化一账户),模拟ATM的业务(取款,100的整数倍,改密               码,查剩余金额.等等,各种简单繁琐的操作 ;-) ) 直接贴代码吧: #include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <string> using na…