fork download
  1. void update (int id, int val) {
  2. int cur = val - a[id];
  3. a[id] = val;
  4. for (; id <= n; id = (id | (id + 1)))
  5. f[id] += cur;
  6. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
void update (int id, int val) {
^
Main.java:1: error: class, interface, or enum expected
void update (int id, int val) {
     ^
Main.java:3: error: class, interface, or enum expected
  a[id] = val;
  ^
Main.java:4: error: class, interface, or enum expected
  for (; id <= n; id = (id | (id + 1)))
  ^
Main.java:4: error: class, interface, or enum expected
  for (; id <= n; id = (id | (id + 1)))
         ^
Main.java:4: error: class, interface, or enum expected
  for (; id <= n; id = (id | (id + 1)))
                  ^
Main.java:6: error: class, interface, or enum expected
}
^
7 errors
stdout
Standard output is empty