diff options
author | Ta180m | 2019-09-04 13:59:06 -0500 |
---|---|---|
committer | GitHub | 2019-09-04 13:59:06 -0500 |
commit | 5b2d60234c7275352044caf8da6a4ce71439cae2 (patch) | |
tree | 4b8eb0dc5771dac9e4309869fa3748c4cc80f75a | |
parent | abc15de1e19117bbddd85479e978533d2bc3887f (diff) |
Update telewire.cpp
-rw-r--r-- | 2007/November/Gold/telewire.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/2007/November/Gold/telewire.cpp b/2007/November/Gold/telewire.cpp index 62de75d..e68ae69 100644 --- a/2007/November/Gold/telewire.cpp +++ b/2007/November/Gold/telewire.cpp @@ -3,9 +3,8 @@ using namespace std; constexpr auto INF = (int)1e9; -int N, C, H, A[105], B[105], DP[105]; - int main() { + int N, C, H, A[105], B[105], DP[105]; cin >> N >> C; for (int i = 0; i < N; i++) { cin >> H; for (int j = 0; j <= 100; j++) DP[j] = (j < H ? INF : (j - H) * (j - H) + (i > 0) * min(A[j] + C * j, B[j] - C * j)); |