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
欢迎参加IJCAI 2020麻将智能体竞赛,大奖等你拿!Welcome to IJCAI 2020 Mahjong AI competition with amazing prizes! | 北京大学《ACM/ICPC大学生程序设计竞赛训练》暑期课面向全球招生!

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