ホームページ  >  記事  >  データベース  >  Codeforces Round #227 (Div. 2)B. George and Round

Codeforces Round #227 (Div. 2)B. George and Round

WBOY
WBOYオリジナル
2016-06-07 15:38:331245ブラウズ

George decided to prepare a Codesecrof round, so he has prepared m problems for the round. Let's number the problems with integers 1 through m . George estimates the i -th problem's complexity by integer b i . To make the round good , he n

George decided to prepare a Codesecrof round, so he has prepared m problems for the round. Let's number the problems with integers1 through m. George estimates the i-th problem's complexity by integer bi.

To make the round good, he needs to put at least n problems there. Besides, he needs to have at least one problem with complexity exactly a1, at least one with complexity exactly a2, ..., and at least one with complexity exactly an. Of course, the round can also have problems with other complexities.

George has a poor imagination. It's easier for him to make some already prepared problem simpler than to come up with a new one and prepare it. George is magnificent at simplifying problems. He can simplify any already prepared problem with complexity c to any positive integer complexity d (c?≥?d), by changing limits on the input data.

However, nothing is so simple. George understood that even if he simplifies some problems, he can run out of problems for a goodround. That's why he decided to find out the minimum number of problems he needs to come up with in addition to the m he's prepared in order to make a good round. Note that George can come up with a new problem of any complexity.

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。