File tree 2 files changed +28
-1
lines changed
2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ #include < vector>
3
+
4
+ using namespace std ;
5
+
6
+ int max (int a, int b) {
7
+ return a > b ? a : b;
8
+ }
9
+ int main () {
10
+ int m = -2147483647 ;
11
+ int n, tmp;
12
+
13
+ cin >> n;
14
+ vector<int > dp (n);
15
+ vector<int > a (n);
16
+ for (int i = 0 ; i < n; i++) {
17
+ cin >> a[i];
18
+ }
19
+ dp[0 ] = a[0 ];
20
+ for (int i = 0 ; i < n; i++) {
21
+ dp[i] = max (dp[i - 1 ] + a[i], a[i]);
22
+ if (m < dp[i]) m = dp[i];
23
+ }
24
+ cout << m;
25
+ return 0 ;
26
+ }
Original file line number Diff line number Diff line change 4
4
| :----:| :---------:| :----:| :-----:| :----:|
5
5
| 1μ°¨μ | 2024.02.12 | DP | [ νλ²ν λ°°λ] ( https://www.acmicpc.net/problem/12865 ) | [ #1 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/5 ) |
6
6
| 2μ°¨μ | 2024.02.15 | Recursion | [ νλ
Έμ΄ ν μ΄λ μμ] ( https://www.acmicpc.net/problem/11729 ) | [ #2 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/8 ) |
7
- | 3μ°¨μ | 2024.02.18 | DP | [ νλ
Έμ΄ ν μ΄λ μμ ] ( https://www.acmicpc.net/problem/10844 ) | [ #3 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/11 ) |
7
+ | 3μ°¨μ | 2024.02.18 | DP | [ μ¬μ΄ κ³λ¨ μ ] ( https://www.acmicpc.net/problem/10844 ) | [ #3 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/11 ) |
8
8
| 4μ°¨μ | 2024.02.18 | Backtracking | [ N-queen] ( https://www.acmicpc.net/problem/9663 ) | [ #4 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/13 ) |
9
9
| 5μ°¨μ | 2024.02.24 | Backtracking | [ μ
λ] ( https://www.acmicpc.net/problem/31413 ) | [ #5 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/18 ) |
10
10
| 6μ°¨μ | 2024.02.27 | BFS | [ ν λ§ν ] ( https://www.acmicpc.net/problem/7576 ) | [ #6 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/20 ) |
11
+ | 7μ°¨μ | 2024.03.01 | DP | [ μ°μν©] ( https://www.acmicpc.net/problem/1912 ) | [ #7 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/25 ) |
11
12
---
You canβt perform that action at this time.
0 commit comments