贪心水题,每次取最短的两个绳子合并,长度缩减成一半 #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <string> #include <map> using namespace std; +; int a[maxn]; int main() { int n; scanf("%d",&am…
1125. Chain the Ropes (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piec…
排序,水题因为最后如果一个学生最好的排名有一样的,输出的课程有个优先级A>C>M>E那么按这个优先级顺序进行排序每次排序前先求当前课程的排名然后再与目前最好的排名比较.更新 至于查询,建立id与索引的映射即可. #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <map> using namespace s…
水题,分组排序即可. #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> using namespace std; /* 太水水水... */ +; int cnt1,cnt2,cnt3,cnt4; struct Node{ int id; int tot; int vir; int tal; bool operator<(const Node t…
Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chain will be treated as another segment of rope and c…
1125 Chain the Ropes (25 分) Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chain will be treated as a…
1125 Chain the Ropes (25 分) Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chain will be treated as a…
Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chain will be treated as another segment of rope and c…
如题... #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string.h> using namespace std; //太水了好吧... int n; ; ; int main() { scanf("%d",&n); ; int now; ; ;i<n;i++){ scanf(&q…
n转化为b进制的格式,问你该格式是否为回文数字(即正着写和倒着写一样)输出Yes或者No并且输出该格式又是水题... #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; ; int a[maxn]; int n,b; int main() { scanf("%d %d",&n,&…