1068 Find More Coins (30)(30 分) Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a speci…
1045 Favorite Color Stripe (30)(30 分) Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pieces and sewing the remaining parts together to…
1040 Longest Symmetric String (25)(25 分) Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given "Is PAT&TAP symmetric?", the longest symmetric sub-string is "s PAT&TAP s",…
满背包问题,把体积和价值看成相等的.用滚动数组优化,然后额外开辟一个choice数组来记录每次的选择,然后回溯打印.因为要按字典序,先把价值进行排序.假如选最小的商品能装满m的话,那就把判断条件改成大于等于,然后最后来 #include<bits/stdc++.h> using namespace std; ]; ]; ]; ][]; int n, m; bool cmp(int a, int b) { return a > b; } int main() { memset(flag,…
1068 Find More Coins (30 分) Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special…
1068. Find More Coins (30) 时间限制 150 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could ac…