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

Re:WA用树状数组 qwq 有大佬帮忙看一下吗

Posted by 1769157748 at 2020-03-31 15:53:06 on Problem 3468
In Reply To:Re:WA用树状数组 qwq 有大佬帮忙看一下吗 Posted by:1769157748 at 2020-03-31 15:51:29
add(sum2, i ,i * (a[i] - a[i - 1]))这里的 i * (a[i] - a[i - 1])溢出int型了
写成 1LL * i * (a[i] - a[i - 1])即可

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