UVa OJ 10055 - Hashmat the Brave Warrior
来源:互联网 发布:文明5 mac 编辑:程序博客网 时间:2024/05/18 03:53
"The input numbers are not greater than 2^32."
int为4个byte,正好是2^(4*8),但是要包括负数,所以int可以存的最大正数是2^(4*8)/2-1,即2147483647。用unsigned int则差1,因为0也要包括在内。
所以还是安心用long吧(我用vs2010和mingw查的sizeof(long)居然也是4。。。,UVaOJ用的cygwin还是够了)
1004676910055Hashmat the Brave WarriorAcceptedC++0.3842012-04-28 04:50:08
#include<iostream>#include<cstdlib>using namespace std;int main(){long p1,p2;while(cin>>p1>>p2){cout<<labs(p2-p1)<<endl;}return 0;}
- UVa OJ 10055-Hashmat the Brave Warrior
- UVa OJ 10055 - Hashmat the Brave Warrior
- UVA OJ: 10055 - Hashmat the Brave Warrior
- UVA oj 10055 Hashmat the Brave Warrior(坑题)
- UVa:10055 - Hashmat the Brave Warrior
- UVa 10055 Hashmat the brave warrior
- uva 10055 Hashmat the Brave Warrior
- UVA 10055 - Hashmat the Brave Warrior
- uva-10055 - Hashmat the Brave Warrior
- uva 10055 Hashmat the Brave Warrior
- UVa 10055 - Hashmat the Brave Warrior
- UVA 10055 Hashmat the brave warrior
- uva 10055 Hashmat the brave warrior
- UVa 10055 Hashmat the brave warrior
- UVA 10055 Hashmat the brave warrior
- UVA - 10055 - Hashmat the Brave Warrior
- uva 10055 - Hashmat the Brave Warrior
- UVa 10055 - Hashmat the Brave Warrior
- 重载new和delete方法实现C++内存安全
- AIX上文件服务的NFS配置
- 感恩
- UVa OJ 489 Hangman Judge
- UVa OJ 488 - Triangle Wave
- UVa OJ 10055 - Hashmat the Brave Warrior
- MSSQL 笔记四
- MSSQL 笔记五
- MSSQL 笔记六
- mssql 2005中top新用法
- UVaOJ 457 - Linear Cellular Automata
- 单个语句快于存储过程的原因分析
- UVaOJ 100 - The 3n + 1 problem
- 删除所有用户表