• hdu 1166 敌兵布阵——(区间和)树状数组/线段树

    时间:2022-02-02 19:03:01

    pid=1166">here:http://acm.hdu.edu.cn/showproblem.php?pid=1166Input第一行一个整数T。表示有T组数据。每组数据第一行一个正整数N(N<=50000),表示敌人有N个工兵营地。接下来有N个正整数,第i个正整数ai代表第i个工兵...

  • hdu1394(枚举/树状数组/线段树单点更新&区间求和)

    时间:2021-11-03 17:56:44

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394题意:给出一个循环数组,求其逆序对最少为多少;思路:对于逆序对: 交换两个相邻数,逆序数+1或-1,交换两个不相邻数a,b,逆序数+=两者间大于a的个数-两者间小于a的个数;所以只要求出初始时的逆序...

  • HDU 3303 Harmony Forever 前缀和+树状数组||线段树

    时间:2021-10-03 19:04:38

    ProblemDescriptionWebelievethateveryinhabitantofthisuniverseeventuallywillfindawaytolivetogetherinharmonyandpeace;thattrust,patience,kindnessandloyalt...