摘要: 循环遍历数组即可,注意临界条件的判断。 #include using namespace std;const int maxn = 102400;int p[maxn], q[maxn];int main(){ //freopen("in.txt", "r", stdin); int... 阅读全文
posted @ 2015-03-13 17:25 Popco 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 这题算贪心中最简单的,属于背包问题吧,写的效率有点低,用数组加指针控制应该更好。 #include #include #include #include #include using namespace std;int main(){ int T; cin >> T; while(... 阅读全文
posted @ 2015-03-13 17:23 Popco 阅读(108) 评论(0) 推荐(0) 编辑