8000 Merge pull request #27 from tongnamuu/master · ChoJH1998/basic-algo-lecture@f23e442 · GitHub
[go: up one dir, main page]

Skip to content

Commit f23e442

Browse files
Merge pull request encrypted-def#27 from tongnamuu/master
boj 11052
2 parents 8cb1bf9 + 96f8e9c commit f23e442

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

0x10/solutions/11052.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
// Authored by : BaaaaaaaaaaarkingDog
1+
// Authored by : tongnamuu
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/a9eee96f33c54876b9d5ba0b1c3bb246
44
#include <bits/stdc++.h>
55
using namespace std;
6-
6+
int d[1001];
77
int main(void){
88
ios::sync_with_stdio(0);
99
cin.tie(0);
10-
11-
}
10+
int n;cin>>n;
11+
for(int i=1;i<=n;++i) cin>>d[i];
12+
for(int i=1;i<=n;++i) for(int j=1;j<i;++j) d[i] = max(d[i-j] + d[j], d[i]);
13+
cout << d[n];
14+
}

0 commit comments

Comments
 (0)
0