Files
2019-03-15 13:47:54 +04:00

36 lines
637 B
Java

package chelper;
import io.InputReader;
import io.OutputWriter;
import solutions.ChelperSolution;
public class B extends ChelperSolution {
@Override
public void solve(int testNumber, InputReader in, OutputWriter out) {
super.solve(testNumber, in, out);
}
@Override
public void solve(int testNumber) {
int n = in.nextInt();
int maxLength = 0;
int curLength = 0;
for (int i = 0; i < n; i++) {
int x = in.nextInt();
if (x == 0) {
curLength = 0;
} else {
curLength++;
maxLength = Math.max(curLength, maxLength);
}
}
out.println(maxLength);
}
}