Usoperanto Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://www.bnuoj.com/v3/contest_show.php?cid=6866#problem/J Description Usoperanto is an artificial spoken language designed and regulated by Usoperanto Academy. The academy is now in study to es…
贪心,对于一个修饰关系可以连一条有向边,在合并的时候,子节点的序列一定是连续安排的,因为如果有交叉,交换以后一定更优. 然后一个序列一个序列的考虑,长度短的应该在前面,否则同样交换以后更优.因此排序以后统计就行了. 数据理论最多递归1e6层,dfs爆栈了,手写栈模拟递归... #include<bits/stdc++.h> using namespace std; ; vector<int> G[maxn]; int M[maxn]; typedef long long ll; l…
On or Off Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/C Description Saving electricity is very important! You are in the office represented as R \times C grid that consists of walls…
Aggressive cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20485 Accepted: 9719 Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,..…
题意:翻煎饼,只能横着翻或者竖着翻.问最多有多少朝上? 行只有10,所以枚举一下2^10的状态,每列取0或1中最大的一个. 在枚举外面把饼翻好,枚举里面指针指一下就好.(位运算或bitset乱搞 #include<bits/stdc++.h> using namespace std; ; ][maxn]; ]; //#define LOCAL int main() { #ifdef LOCAL freopen("in.txt","r",stdin); #…