fork download
  1. public class MaxTree extends SegmentsTree {
  2.  
  3. public MaxTree(int[] a) {
  4. super(a);
  5. }
  6.  
  7. @Override
  8. public int defaultDelta() {
  9. return -Integer.MAX_VALUE;
  10. }
  11.  
  12. @Override
  13. public int operation(int a, int b) {
  14. return Math.max(a, b);
  15. }
  16.  
  17. @Override
  18. public int defaultValue() {
  19. return 0;
  20. }
  21.  
  22. @Override
  23. public void change(int v, int delta) {
  24. func[v] += delta;
  25. this.delta[v] += delta;
  26. }
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class MaxTree is public, should be declared in a file named MaxTree.java
public class MaxTree extends SegmentsTree {
       ^
Main.java:1: error: cannot find symbol
public class MaxTree extends SegmentsTree {
                             ^
  symbol: class SegmentsTree
Main.java:7: error: method does not override or implement a method from a supertype
        @Override
        ^
Main.java:12: error: method does not override or implement a method from a supertype
        @Override
        ^
Main.java:17: error: method does not override or implement a method from a supertype
        @Override
        ^
Main.java:24: error: cannot find symbol
            func[v] += delta;
            ^
  symbol:   variable func
  location: class MaxTree
Main.java:25: error: cannot find symbol
            this.delta[v] += delta;
                ^
  symbol: variable delta
Main.java:22: error: method does not override or implement a method from a supertype
        @Override
        ^
8 errors
stdout
Standard output is empty