aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTa180m2019-07-16 14:52:58 -0700
committerGitHub2019-07-16 14:52:58 -0700
commitf5f3187bdcd7b0b796ed75d418668990e79e35e7 (patch)
tree14ee0be06a0f0d36ca70c462e53d36cd21d193c4
parenta1240210e0aa5759bcb224d3ef04e93dc0f683cf (diff)
Update nochange.cpp
-rw-r--r--2013/November/Gold/nochange.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/2013/November/Gold/nochange.cpp b/2013/November/Gold/nochange.cpp
index 9ba1958..ad34b80 100644
--- a/2013/November/Gold/nochange.cpp
+++ b/2013/November/Gold/nochange.cpp
@@ -14,18 +14,14 @@ int main() {
p[i + 1] = c + p[i];
}
- for (int i = 0; i < (1 << K); i++) {
- if (DP[i] < N) {
- for (int j = 0; j < K; j++) {
- if ((i & 1 << j) == 0) {
- int l = DP[i], h = N;
- while (l + 1 < h) {
- int m = (l + h) / 2;
- sum(DP[i], m) > v[j] ? h = m : l = m;
- }
- DP[i ^ 1 << j] = max(l + 1, DP[i ^ 1 << j]);
- }
+ for (int i = 0; i < (1 << K); i++) if (DP[i] < N) {
+ for (int j = 0; j < K; j++) if ((i & 1 << j) == 0) {
+ int l = DP[i], h = N;
+ while (l + 1 < h) {
+ int m = (l + h) / 2;
+ sum(DP[i], m) > v[j] ? h = m : l = m;
}
+ DP[i ^ 1 << j] = max(l + 1, DP[i ^ 1 << j]);
}
}