mod =1？0？-1？
\n/*\n *\u4F5C\u8005@v7fgg\n *\u6267\u884C\u7528\u65F6 :11 ms, \u5728\u6240\u6709 Java \u63D0\u4EA4\u4E2D\u51FB\u8D25\u4E867.45%\u7684\u7528\u6237\n *\u5185\u5B
```\n/*\n *\u4F5C\u8005@v7fgg\n *\u6267\u884C\u7528\u65F6 :11 ms, \u5728\u6240\u6709 Java \u63D0\u4EA4\u4E2D\u51FB\u8D25\u4E867.45%\u7684\u7528\u6237\n *\u5185\u5B58\u6D88\u8017 :37.9 MB, \u5728\u6240\u6709 Java \u63D0\u4EA4\u4E2D\u51FB\u8D25\u4E86100.00%\u7684\u7528\u6237\n *2020\u5E745\u670827\u65E5 19:54\n */\nclass Solution {\n    public String baseNeg2(int N) {\n        if(N==0){\n            return "0";\n        }\n        String ans="";\n        while(N!=0){\n            if(N%(-2)==-1){\n                ans=1+ans;\n            }\n            else{\n                ans=N%(-2)+ans;\n            }\n            if(N%(-2)==-1){\n                N/=-2;\n                N++;\n                continue;\n            }\n            N/=-2;\n        }return ans;\n    }\n}\n//on leetcode.com\n//Runtime: 8 ms, faster than 9.86% of Java online submissions for Convert to Base -2.\n//Memory Usage: 37.4 MB, less than 10.00% of Java online submissions for Convert to Base -2.\n//\u53C2\u8003\u8D44\u6599\uFF1Ahttps://leetcode-cn.com/problems/convert-to-base-2/solution/zhu-yao-kao-lu-yi-xia-yu-shu-wei-fu-shu-de-wen-ti-/\n```
['Java']