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 |
Tags
- 레드마인테마
- sqlmap 경고
- pg환경변수
- .env
- Java
- tomcat install
- intelij sqlmap
- 배열컬럼
- node.js postgresql
- 배열크기
- intelij mybatis
- dotenv
- CentOS
- multi instance
- nodejs 환경변수처리
- Redmine theme
- node postgresql
- 패키지
- 레드마인 테마
- Node
- rpm목록
- 메소드한줄
- sqlmap warring
- 멀티 인스턴스
- 리액트네이티브
- 레드마인
- redmine
- yum목록
- rpm설치목록
- yum설치목록
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);
}
}
Comments