"Can you answer these queries I" challenge
static int[] dist ; 
static int[][][] vis;
static ArrayList&lt;Integer&gt;[] resu;
static char[][] graph;
static int max;
static int min;
static int[] dp;
static int zz;
static int zzz;
static nodes[] som;
static nodes temp; 
static boolean fin;


Your variable names are very hard to understand. What's dist? Distance? Then why is it an array? What's vis? Visuals? Why is it a 3D array?

Make your variable names clearer, and add comments what it does.

Also, there is inconsistent spacing. You do stuff like:

static int[] dist ;


and you also do:

static int[][][] vis;


Be consistent. The conventions are "no space before ;", so this:

static int[][][] vis;


is correct. Also:

static class nodes{


Standard conventions for class names are PascalCase, not camelCase or alllowercase.

Also, I think all your variables need some breathing space:

if(j&lt;=mid) return query(2*current, a, (a+b)/2, i, j);


should be:

if(j &lt;= mid) return query(2 * current, a, (a + b) / 2, i, j);


Also, your formatting seems messed up. You have extra spaces everywhere, so try removing them.