请哪位高手帮忙翻译一下!!!! 10
OwenhadbeenthroughunrequitedlovewithNMMforalongtime.Inordertocelebratethe8thanniversa...
Owen had been through unrequited love with N MM for a long time. In order to celebrate the 8th anniversary of ZOJ, he decided to "watch white".
One night, MMs are sitting in a ring. Owen's plan is to give them love letters secretly so that MMs who receive letters will know that Owen loves them. Besides, each MM has a "happy point". The greater it is, the happier Owen will be if that MM receives his love letter.
One more problem. MM is very sensitive, so she will know if Owen (even secretly) drops a letter to the girl next to her. Meanwhile, MM is likely to be jealous. If she receives the love letter and finds that some other girl also gets a love letter, she will pia Owen to death.
Owen, as a smart boy, won't let MM pia him, and decides to program to calculate the maximum sum of happy points he can get. However, love is blind. Poor Owen has lost the ability to program. So he turns to you.
Input
There are no more than 10 test cases.
Each test case begins with an integer N (1 <= N <= 1000000).
Then followed N integers(0<= Ni <= 1000), each representing a happy point for one MM. The first and last MM sit next to each other, forming a ring.
Each test case occupies one line.
Output
One line for each test case.
An interger for each line indicating the maximum sun of happy points Owen can get.
Sample Input
5 1 2 3 4 5
6 1 2 3 4 5 6
Sample Output
8
12 展开
One night, MMs are sitting in a ring. Owen's plan is to give them love letters secretly so that MMs who receive letters will know that Owen loves them. Besides, each MM has a "happy point". The greater it is, the happier Owen will be if that MM receives his love letter.
One more problem. MM is very sensitive, so she will know if Owen (even secretly) drops a letter to the girl next to her. Meanwhile, MM is likely to be jealous. If she receives the love letter and finds that some other girl also gets a love letter, she will pia Owen to death.
Owen, as a smart boy, won't let MM pia him, and decides to program to calculate the maximum sum of happy points he can get. However, love is blind. Poor Owen has lost the ability to program. So he turns to you.
Input
There are no more than 10 test cases.
Each test case begins with an integer N (1 <= N <= 1000000).
Then followed N integers(0<= Ni <= 1000), each representing a happy point for one MM. The first and last MM sit next to each other, forming a ring.
Each test case occupies one line.
Output
One line for each test case.
An interger for each line indicating the maximum sun of happy points Owen can get.
Sample Input
5 1 2 3 4 5
6 1 2 3 4 5 6
Sample Output
8
12 展开
2个回答
展开全部
欧文已经很长时间经历回报爱用N MM.为了庆祝第8ZOJ的周年,他决定"注意白色".一晚上,毫米正坐在一个戒指上.欧文的计划是要秘密给出他们情书,因此收到文学的毫米将知道欧文爱他们.此外,每一MM有一"愉快点".它越较大意愿条件其MM收到他的情书的欧文越更愉快.还有一问题.MM是非常敏感,所以她将知道如果欧文对紧挨着她女孩(甚至秘密)放下一封信.同时 ,MM是可能是嫉妒.如果她收到情书和发现一些另一女孩也得到一情书,她希望pia欧文向死. 作为一个聪明男孩欧文将不出租MM pia他和决定设计程序计算他能得到的愉快点的最大总和 .但是,爱是盲目.可怜欧文已经失去设计程序的才能.那样他求助于你.投入事实上没有超过 10个与相比判例案件.每一判例案件以一整数N((1<=N<=1000000)开始.然后随着N整数((0<= Ni<=1000)到来每个代表一愉快的点为一毫米.主要MM紧挨着彼此坐着围成圈.每一判例案件占据一线.为每一判例案件使出一线.一为每一指示愉快点欧文的最大太阳线interger能到达 .Sample投入5 1 2 3 4 5 6 1 2 3 4 5 6Sample使出8 12
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
欧文已经通过暗恋N MM了好长一段时间。为了庆祝回归八周年的ZOJ时,他决定“看白”。
一天晚上,mm都是坐成一圈。欧文的计划是给他们的情书秘密使MMs收到信就知道欧文热爱他们。除此之外,每一个MM有着“幸福”。更大的是,幸福,如果欧文将会收到他的情书MM。
一个更大的问题。MM是很敏感,所以她知道如果欧文(甚至秘密)下降到隔壁的那个女孩写了一封信给她。同时,MM可能是嫉妒。如果她的情书,发现一些其他的女孩也会写一封情书,她会引出欧文死。
欧文,作为一个聪明的男孩,他不会让MM引出,于是决定程序的最大的快乐,他能得到积分。然而,爱情是盲目的。可怜的欧文已经失去能力计划。所以他转到你。
输入, 有不超过10个测试。
每个测试用例始于一个整数N(1)和(2)< = N < = 100万)。
然后N整数(0 < =镍< = 1000个),他们都为一个幸福的观点。第一个和最后一个MM坐在对方,形成一个戒指。
每个测试用例占一行。
输出
一行每个测试用例。
每一个interger线显示太阳的最大幸福。点欧文。
样品输入,
5拿到手
6拿到手五6
样品输出
8
12
一天晚上,mm都是坐成一圈。欧文的计划是给他们的情书秘密使MMs收到信就知道欧文热爱他们。除此之外,每一个MM有着“幸福”。更大的是,幸福,如果欧文将会收到他的情书MM。
一个更大的问题。MM是很敏感,所以她知道如果欧文(甚至秘密)下降到隔壁的那个女孩写了一封信给她。同时,MM可能是嫉妒。如果她的情书,发现一些其他的女孩也会写一封情书,她会引出欧文死。
欧文,作为一个聪明的男孩,他不会让MM引出,于是决定程序的最大的快乐,他能得到积分。然而,爱情是盲目的。可怜的欧文已经失去能力计划。所以他转到你。
输入, 有不超过10个测试。
每个测试用例始于一个整数N(1)和(2)< = N < = 100万)。
然后N整数(0 < =镍< = 1000个),他们都为一个幸福的观点。第一个和最后一个MM坐在对方,形成一个戒指。
每个测试用例占一行。
输出
一行每个测试用例。
每一个interger线显示太阳的最大幸福。点欧文。
样品输入,
5拿到手
6拿到手五6
样品输出
8
12
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询