fork download
  1.  
  2.  
  3. const ll felix = (ll)2e6;
  4.  
  5. struct Tree{
  6.  
  7. ll t[felix], f[felix];
  8.  
  9. Tree(){
  10. fill(f, f + felix, 0);
  11. fill(t, t + felix, 0);
  12. }
  13.  
  14. void Push(ll v){
  15. if(f[v]){
  16. t[v * 2] += f[v];
  17. t[v * 2 + 1] += f[v];
  18. f[v * 2] += f[v];
  19. f[v * 2 + 1] += f[v];
  20. f[v] = 0;
  21. }
  22. }
  23.  
  24. void Inc(ll v, ll tl, ll tr, ll l, ll r, ll val){
  25. ll tm = (tl + tr) >> 1;
  26. Push(v);
  27. if(l > r) return;
  28. if(l == tl && r == tr){
  29. t[v] += val;
  30. f[v] += val;
  31. return;
  32. }
  33. Inc(v * 2, tl, tm, l, min(r, tm), val);
  34. Inc(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r, val);
  35. t[v] = min(t[v * 2], t[v * 2 + 1]);
  36. }
  37.  
  38. ll Get(ll v, ll tl, ll tr, ll l, ll r){
  39. Push(v);
  40. ll tm = (tl + tr) >> 1;
  41. if(l > r)
  42. return ll(1e9);
  43. if(l == tl && r == tr)
  44. return t[v];
  45. return min(Get(v * 2, tl, tm, l, min(r, tm)),
  46. Get(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r));
  47. }
  48.  
  49. ~Tree(){}
  50. }T;
  51.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:7: error: ‘ll’ does not name a type
 const ll felix = (ll)2e6;
       ^~
prog.cpp:7:5: error: ‘ll’ does not name a type
     ll t[felix], f[felix];
     ^~
prog.cpp:14:15: error: ‘ll’ has not been declared
     void Push(ll v){
               ^~
prog.cpp:24:14: error: ‘ll’ has not been declared
     void Inc(ll v, ll tl, ll tr, ll l, ll r, ll val){
              ^~
prog.cpp:24:20: error: ‘ll’ has not been declared
     void Inc(ll v, ll tl, ll tr, ll l, ll r, ll val){
                    ^~
prog.cpp:24:27: error: ‘ll’ has not been declared
     void Inc(ll v, ll tl, ll tr, ll l, ll r, ll val){
                           ^~
prog.cpp:24:34: error: ‘ll’ has not been declared
     void Inc(ll v, ll tl, ll tr, ll l, ll r, ll val){
                                  ^~
prog.cpp:24:40: error: ‘ll’ has not been declared
     void Inc(ll v, ll tl, ll tr, ll l, ll r, ll val){
                                        ^~
prog.cpp:24:46: error: ‘ll’ has not been declared
     void Inc(ll v, ll tl, ll tr, ll l, ll r, ll val){
                                              ^~
prog.cpp:38:5: error: ‘ll’ does not name a type
     ll Get(ll v, ll tl, ll tr, ll l, ll r){
     ^~
prog.cpp: In constructor ‘Tree::Tree()’:
prog.cpp:10:14: error: ‘f’ was not declared in this scope
         fill(f, f + felix, 0);
              ^
prog.cpp:10:21: error: ‘felix’ was not declared in this scope
         fill(f, f + felix, 0);
                     ^~~~~
prog.cpp:10:29: error: ‘fill’ was not declared in this scope
         fill(f, f + felix, 0);
                             ^
prog.cpp:11:14: error: ‘t’ was not declared in this scope
         fill(t, t + felix, 0);
              ^
prog.cpp: In member function ‘void Tree::Push(int)’:
prog.cpp:15:12: error: ‘f’ was not declared in this scope
         if(f[v]){
            ^
prog.cpp:16:13: error: ‘t’ was not declared in this scope
             t[v * 2] += f[v];
             ^
prog.cpp: In member function ‘void Tree::Inc(int, int, int, int, int, int)’:
prog.cpp:25:9: error: ‘ll’ was not declared in this scope
         ll tm = (tl + tr) >> 1;
         ^~
prog.cpp:29:13: error: ‘t’ was not declared in this scope
             t[v] += val;
             ^
prog.cpp:30:13: error: ‘f’ was not declared in this scope
             f[v] += val;
             ^
prog.cpp:33:24: error: ‘tm’ was not declared in this scope
         Inc(v * 2, tl, tm, l, min(r, tm), val);
                        ^~
prog.cpp:33:40: error: ‘min’ was not declared in this scope
         Inc(v * 2, tl, tm, l, min(r, tm), val);
                                        ^
prog.cpp:34:49: error: ‘max’ was not declared in this scope
         Inc(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r, val);
                                                 ^
prog.cpp:35:9: error: ‘t’ was not declared in this scope
         t[v] = min(t[v * 2], t[v * 2 + 1]);
         ^
stdout
Standard output is empty