fork download
  1. #define NMAX 100010
  2.  
  3. int tree[NMAX];
  4. int N;
  5.  
  6. int read(int x){
  7. int sum = 0;
  8. for(; x; x -= (x&-x)){
  9. sum += tree[x];
  10. }
  11.  
  12. return sum;
  13. }
  14.  
  15. void update(int x, int val){
  16. for(; x < N; x += (x&-x)){
  17. tree[x] += val;
  18. }
  19. }
  20.  
  21. int query(int i, int j){
  22. return read(j)-read(i-1);
  23. }
  24.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i586-linux-gnu/5/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty