↓ Skip to main content
  1. Tags/

树状数组

2015

sgu 180 - Inversions (离散化+树状数组)

·507 words·2 mins
Inversions **Time Limit:**250MS **Memory Limit:**4096KB 64bit IO Format:%I64d & %I64u Submit Status Description 180. Inversions # time limit per test: 0.25 sec. memory limit per test: 4096 KB input: standard output: standard There are N integers (1<=N<=65537) A1, A2,.. AN (0<=Ai<=10^9). You need to find amount of such pairs (i, j) that 1<=iA[j]. Input The first line of the input contains the number N. The second line contains N numbers A1…AN.

poj 2481 Cows(树状数组||线段树)

·1589 words·4 mins
poj 2481 题目链接 题意:给定n个区间,问对于每个区间,有多少个区间真包含该区间(真包含的意思是说,两个区间不能完全重合) 思路: 下面是一年前用树状数组过掉的时候写的题解: 和 star那道题差不多。