- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class Squeeezy {
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- String raw[];
- int c, t;
- Squeeezy() throws Exception {
- raw = br.readLine().split(" ");
- for (int i = 0, len = raw.length; i < len; i++) { // i=0;i<raw.length;i++
- t = Integer.parseInt(raw[i]);
- if (i == 0)
- c = 0;
- t = 0;
- c = Math.max(c + t, t);
- t = Math.max(c, t);
- }
- System.out.println(t);
- }
- public static void main(String[] args) throws Exception {
- new Squeeezy();
- }
- }
複製代碼 |