HBC54305活着的证据(T1),贪心Guest Student题解

痛心疾首 算法基础篇 40 0
想要成为编程高手?那就来试试全网最全C++题库,让您在练习中快速成长。
Berland State University invites people from all over the world as guest students. You can come to the capital of Berland and study with the best teachers in the country. Berland State University works every day of the week, but classes for guest students are held on the following schedule. You know the sequence of seven integers a1, a2, …, a7 : a1 = 1 if and only if there are classes for guest students on Sundays; a2 = 1 if and only if there are classes for guest students on Mondays; …

Berland State University invites people from all over the world as guest students. You can come to the capital of Berland and study with the best teachers in the country. Berland State University works every day of the week, but classes for guest students are held on the following schedule. You know the sequence of seven integers a1, a2, …, a7 (ai = 0 or ai = 1): a1 = 1 if and only if there are classes for guest students on Sundays; a2 = 1 if and only if there are classes for guest students on Mondays; … a7 = 1 if and only if there are classes for guest students on Saturdays. The classes for guest students are held in at least one day of a week. You want to visit the capital of Berland and spend the minimum number of days in it to study k days as a guest student in Berland State University. Write a program to find the length of the shortest continuous period of days to stay in the capital to study exactly k days as a guest student.

HBC54305活着的证据(T1),贪心Guest Student题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
想要在职场中立于不败之地?那就来试试全网最全C++题库,让您在练习中快速提升技能。

标签: HBC54305活着的证据(T1) 贪心Guest Student题解