B. Valera and Fruits time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Valera loves his garden, where n fruit trees grow. This year he will enjoy a great harvest! On the i-th tree bi fruit gr…
纯粹练JAVA.... A. Valera and Antique Items time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Valera is a collector. Once he wanted to expand his collection with exactly one antique item. Valera…
B. Valera and Fruits time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Valera loves his garden, where n fruit trees grow. This year he will enjoy a great harvest! On the i-th tree bi fruit gr…
B. Valera and Fruits time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Valera loves his garden, where n fruit trees grow. This year he will enjoy a great harvest! On the i-th tree bi fruit gr…
题目链接:http://codeforces.com/problemset/problem/441/B 题目意思:有 n 棵fruit trees,每课水果树有两个参数描述:水果成熟的时间和这棵树上水果的数量.已知Valera 每天最多可以采摘 v 个水果,而每棵fruit tree能被采摘水果的天数只能在它水果成熟的那一日(ai)和后一日(ai+1),超过这两日就不能采摘这棵树的水果了.问如何操作可以使最后采摘到的水果数最多. 实不相瞒,做这条题做得蛮久的,可能与忙于考试没怎么做题有关....…
#include <iostream> #include <vector> #include <algorithm> #include <map> using namespace std; int main(){ int n,v; cin >> n >>v; map<int,int> fruit; ; i < n; ++ i ){ int a,b; cin >>a >> b; if(fruit…
Problem description Valera loves his garden, where n fruit trees grow. This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be…