aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTa180m2019-09-04 13:59:06 -0500
committerGitHub2019-09-04 13:59:06 -0500
commit5b2d60234c7275352044caf8da6a4ce71439cae2 (patch)
tree4b8eb0dc5771dac9e4309869fa3748c4cc80f75a
parentabc15de1e19117bbddd85479e978533d2bc3887f (diff)
Update telewire.cpp
-rw-r--r--2007/November/Gold/telewire.cpp3
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));