We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
/* * @lc app=leetcode.cn id=1017 lang=cpp * @lcpr version= * * [1017] 负二进制转换 */ #include <array> #include <bitset> #include <climits> #include <deque> #include <functional> #include <tuple> #include <utility> #include <list> #include <forward_list> #include <stack> #include <algorithm> #include <queue> #include <vector> #include <string> #include <numeric> #include <iostream> #include <map> #include <unordered_map> #include <set> #include <unordered_set> using namespace std; // @lc code=start class Solution { public: string baseNeg2(int n) { int val = 0x55555555 ^ (0x55555555 - n); if (val == 0) return "0"; string res; while (val > 0) { res.push_back('0' + (val & 1)); val >>= 1; } reverse(res.begin(), res.end()); return res; } }; // @lc code=end /* // @lcpr case=start // 2\n // @lcpr case=end // @lcpr case=start // 3\n // @lcpr case=end // @lcpr case=start // 4\n // @lcpr case=end */
报错信息如下图:
The text was updated successfully, but these errors were encountered:
修复了,2.19.2,感谢
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
报错信息如下图:

The text was updated successfully, but these errors were encountered: