-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bitmask DP Merging Bitmasks #5056
base: master
Are you sure you want to change the base?
Conversation
#include "bits/stdc++.h" | ||
using namespace std; | ||
void solve() { | ||
int n, m, inf = 1e9; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mention inf
as const
outside the function
} | ||
|
||
int32_t main() { | ||
std::ios::sync_with_stdio(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these and maybe include everything under main()
function only.
void solve() { | ||
int n, m, inf = 1e9; | ||
cin >> n >> m; | ||
vector<int> adj(n), dp(1 << n, inf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write it separately
cout << dp[(1 << n) - 1] << "\n"; | ||
} | ||
|
||
int32_t main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int32_t main() { | |
int main() { |
<CPPSection> | ||
|
||
```cpp | ||
#include "bits/stdc++.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "bits/stdc++.h" | |
#include <bits/stdc++.h> |
@@ -14,6 +14,20 @@ | |||
} | |||
} | |||
], | |||
"sam2": [ | |||
{ | |||
"uniqueId": "ac-close-group", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"uniqueId": "ac-close-group", | |
"uniqueId": "ac-CloseGroup", |
Place an "x" in the corresponding checkbox if it is done or does not apply to this pull request.
This is intended to add new content for the O(3^N) Bitmask DP problems. Some of what is added is in the SOS DP module already, but this strictly targets the problems that cannot be solved using SOS DP. Let me know if even this simplifed content is unsuitable for Gold.