codeforces MUH and Important Things】的更多相关文章

/* 题意:给一个序列,表示每一项任务的难度,要求完成每一项任务的循序是按照难度由小到大的!输出三种符合要求的工作顺序的序列! 思路:直接看代码.... */ 1 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #define N 2005 using namespace std; struct node{ int h; int p; }; node nd[N…
B. MUH and Important Things time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output It's time polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kie…
题目链接:http://codeforces.com/problemset/problem/471/B 题目意思:有 n 个 tasks,编号依次为 1 - n,每个 task 都有一定的难度值来评估.例如,第 i 个 task 的难度值为 hi.现在的任务是把 n 个 task 全部完成,难度值越小的task越先完成.有3个人,都希望自己完成所有task的输出序列是与众不同的,问是否存在至少3条完成所有task的不同序列,没有的话输出 “NO”,否则输出“YES”并输出3条不同的完成序列. 昨…
It's time polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got down to business. In total, there are n tasks for the day and each animal should do each of these tasks. For each task, they have e…
原题链接:http://codeforces.com/gym/100338/attachments/download/2136/20062007-winter-petrozavodsk-camp-andrew-stankevich-contest-22-asc-22-en.pdf 题意 给你一个无向图,要从1走到n,问你哪些边去掉之后就没法走原本的最短路了. 题解 跑两发最短路,顺着跑一发,倒着跑一发,对于边(u,v),如果w(u,v)+d[u]+rd[v]或者w(u,v)+d[v]+rd[u]…
正反两次最短路用于判断边是不是最短路上的边,把最短路径上的边取出来建图.然后求割边.注意重边,和卡spfa. 正权,好好的dijkstra不用,用什么spfa? #include<bits/stdc++.h> using namespace std; typedef long long ll; #define fi first #define se second #define bug(x) cout<<#x<<'='<<x<<endl; #de…
题意:给定两个序列a ,b, 如果在a中存在一段连续的序列使得 a[i]-b[0]==k, a[i+1]-b[1]==k.... a[i+n-1]-b[n-1]==k 就说b串在a串中出现过!最后输出b串在a串中出现几次! 思路: KMP变形!如何转换成KMP求解呢? 举一个例子说明一下: a: 5 10 8 10 11 9 11 12 10 15 b: 4 2 4 5 3 根据题意 a中的 10 8 10 11 9 与 b是匹配的, 11 9 11 12 10跟b也是匹配的! 如何将b串以及…
MUH and Important Things CodeForces - 471B It's time polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got down to business. In total, there are ntasks for the day and each animal should do each…
MUH and House of Cards Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 471C Description Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo o…
C - Important RoadsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88926#problem/C Description The city where Georgie lives has n junctions some of which are connected by bidirectional roads. Every d…