2013
12-29

# Has the sum exceeded

As we all know, in the computer science, an integer A is in the range of 32-signed integer, which means the integer A is between -2^31 and (2^31)-1 (inclusive), and A is a 64-signed integer, which means A is between -2^63 and (2^63)-1(inclusive). Now we give the K-signed range, and two K-signed integers A and B, you should check whether the sum of A and B is beyond the range of K-signed integer or not.

There will be many cases to calculate. In each case, there comes the integer K (2<=K<=64) first in a single line. Then following the line, there is another single line which has two K-signed integers A and B.

There will be many cases to calculate. In each case, there comes the integer K (2<=K<=64) first in a single line. Then following the line, there is another single line which has two K-signed integers A and B.

32
100 100

WaHaHa

http://acm.hdu.edu.cn/showproblem.php?pid=2116

#include <stdio.h>
int k;
__int64 a,b;
__int64 pow(int x,int y)
{
int i;
__int64 s=1;
for(i=0;i<y;i++)
s*=x;
return s;
}
#define MAX pow(2,63)
int test()
{
__int64 max,min;
if(k==64)min=-MAX,max=MAX-1;
else
min=-MAX>>k,max=(MAX>>k)-1;
if(a==0&&b==0)return 0;
if(a>0&&b<0)return 0;
if(a<0&&b>0)return 0;
if(a>0)
return (max-a)<b;
return (min-a)>b;
}
int main()
{
while(~scanf("%d",&k))
{
scanf("%I64d%I64d",&a,&b);
printf(test()?"Yes\n":"WaHaHa\n");
}
return 0;
}

1. 我就纯粹推测下，我能有什么心态？难道不能推测？当然，如果真的是我推测错误的话，这是个真人，那我深表同情，并且对这个吉祥物致以严重谴责。但是，我之前那个评论并没有对受害者任何不敬的地方吧？你也不用把自己放在道德的最高点对我进行批判。

2. Good task for the group. Hold it up for every yeara??s winner. This is a excellent oppotunity for a lot more enhancement. Indeed, obtaining far better and much better is constantly the crucial. Just like my pal suggests on the truth about ab muscles, he just keeps obtaining much better.