HBC24021小宝的冰激凌[USACO 2016 Jan S]Subsequences Summing to Sevens题解

素流年 算法基础篇 44 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
Farmer John's N cows are standing in a row, as they have a tendency to do from time to time. Each cow is labeled with a distinct integer ID number so FJ can tell them apart. FJ would like to take a photo of a contiguous group of cows but, due to a traumatic childhood incident involving the numbers 1…6, he only wants to take a picture of a group of cows if their IDs add up to a multiple of 7.Please help FJ determine the size of the largest group he can photograph.

Farmer John's N cows are standing in a row, as they have a tendency to do from time to time. Each cow is labeled with a distinct integer ID number so FJ can tell them apart. FJ would like to take a photo of a contiguous group of cows but, due to a traumatic childhood incident involving the numbers 1…6, he only wants to take a picture of a group of cows if their IDs add up to a multiple of 7. Please help FJ determine the size of the largest group he can photograph.

HBC24021小宝的冰激凌[USACO 2016 Jan S]Subsequences Summing to Sevens题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: HBC24021小宝的冰激凌[USACO 2016 Jan S]Subsequences Summing to Sevens题解