Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

一次性AC,真难得,给个提示

Posted by jxnuxiaoyong at 2009-07-20 16:52:51 on Problem 3399
对正数和负数分别排序,用两个数组标示(0另外考虑)

先判断K是否为奇数,如果是,选中正数的最大的数,K就成偶数了
K为偶数时,判断最大两个正数的积与最小两个负数的积的大小,谁大选谁中的那两个数

本题就是0的情况比较烦人,需另外仔细考虑

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator