Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 리액트네이티브
- Node
- Redmine theme
- node.js postgresql
- rpm목록
- sqlmap warring
- intelij sqlmap
- 멀티 인스턴스
- CentOS
- nodejs 환경변수처리
- yum목록
- node postgresql
- 패키지
- yum설치목록
- 메소드한줄
- pg환경변수
- Java
- dotenv
- tomcat install
- multi instance
- 배열컬럼
- redmine
- .env
- rpm설치목록
- intelij mybatis
- 레드마인테마
- sqlmap 경고
- 레드마인 테마
- 배열크기
- 레드마인
Archives
- Today
- Total
ZeroRadish
[백준] 1912번 연속합(JAVA) 본문
https://www.acmicpc.net/problem/1912
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int max = Integer.MIN_VALUE, currentSum = 0;
for (int i = 0; i < N; i++) {
int num = scanner.nextInt();
currentSum = Math.max(num, currentSum + num);
max = Math.max(max, currentSum);
}
System.out.println(max);
}
}