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 whenmary at 2008-05-30 20:13:35 on Problem 2231
这道题格式输入输出比较麻烦,要用long long(vc不支持,不过poj支持),_int64vc倒是支持,结果这里又不支持了。。。(我用c++,不知道g++怎么样)
要用O(nlogn)做,暴力肯定超时
先排序,再用o(n)做就可以了
不要忘记初始化,还有sum和数组都要用long long的
输入输出时用%I64d(重要!)
cout和cin会超。。。

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