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
首先我用的是Visual Studio 2015,之前觉得这题很水,直接写了一个for(int i=0;i<=x;i++)的循环,然后超时,来看了柳神的代码,发现可以使用二分法,我也根据你的long来的,但是发现还是卡住不出结果,所以我就单步调试了一下,发现mid和left都变成负的很大的数字了,看着像是溢出,这时候我把mid改成long long类型,就迅速的返回了结果~ 还有一个地方在最外面定义了long mid =0,循环里面又定义long mid啦~~
The text was updated successfully, but these errors were encountered:
sizeof(long int)=sizeof(int)=sizeof(long)
Sorry, something went wrong.
No branches or pull requests
首先我用的是Visual Studio 2015,之前觉得这题很水,直接写了一个for(int i=0;i<=x;i++)的循环,然后超时,来看了柳神的代码,发现可以使用二分法,我也根据你的long来的,但是发现还是卡住不出结果,所以我就单步调试了一下,发现mid和left都变成负的很大的数字了,看着像是溢出,这时候我把mid改成long long类型,就迅速的返回了结果~ 还有一个地方在最外面定义了long mid =0,循环里面又定义long mid啦~~
The text was updated successfully, but these errors were encountered: