Main.java:13: error: incompatible types: int[] cannot be converted to int
int dp = new int[n];
^
Main.java:16: error: array required, but int found
if(g[i] > g[j]) dp[i] = Math.max(dp[i], dp[j]);
^
Main.java:16: error: array required, but int found
if(g[i] > g[j]) dp[i] = Math.max(dp[i], dp[j]);
^
Main.java:16: error: array required, but int found
if(g[i] > g[j]) dp[i] = Math.max(dp[i], dp[j]);
^
Main.java:18: error: array required, but int found
dp[i] ++;
^
Main.java:19: error: array required, but int found
res = Math.max(res, dp[i]);
^
Main.java:21: error: incompatible types: int[] cannot be converted to int
dp = new int[n];
^
Main.java:24: error: array required, but int found
if(g[i] > g[j]) dp[i] = Math.max(dp[i], dp[j]);
^
Main.java:24: error: array required, but int found
if(g[i] > g[j]) dp[i] = Math.max(dp[i], dp[j]);
^
Main.java:24: error: array required, but int found
if(g[i] > g[j]) dp[i] = Math.max(dp[i], dp[j]);
^
Main.java:26: error: array required, but int found
dp[i] ++;
^
Main.java:27: error: array required, but int found
res = Math.max(res, dp[i]);
^
12 errors