A - The Moronic Cowmpouter】的更多相关文章

The Moronic Cowmpouter Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4006   Accepted: 2079 Description Inexperienced in the digital arts, the cows tried to build a calculating engine (yes, it's a cowmpouter) using binary numbers (base…
Description Inexperienced in the digital arts, the cows tried to build a calculating engine (yes, it's a cowmpouter) using binary numbers (base 2) but instead built one based on base negative 2! They were quite pleased since numbers expressed in base…
题目链接 题意 : 将一个10进制整数转化为-2进制的数. 思路 :如果你将-2进制下的123转化为十进制是1*(-2)^2+2*(-2)^1+3*(-2)^0.所以十进制转化为-2进制就是一个逆过程.找到最小的非负整数x使得当前数减x能被2整除,这个x将作为新的最高位写到结果中,然后当前数减去x再除以-2,貌似在这里不能严格的说是余数,因为负数的余数不太准确. //POJ 3191 #include <stdio.h> #include <string.h> #include &…
http://poj.org/problem?id=3191 题意:将一个整型的十进制整数转化为-2进制整数. #include <stdio.h> #include <algorithm> #include <stdlib.h> #include <string.h> #define LL long long using namespace std; int main() { LL n,s[]; while(~scanf("%lld",…
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze 广度搜索1006 Redraiment猜想 数论:容斥定理1007 童年生活二三事 递推题1008 University 简单hash1009 目标柏林 简单模拟题1010 Rails 模拟题(堆栈)1011 Box of Bricks 简单题1012 IMMEDIATE DECODABILITY…
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028.1029. 1032.1037.1040.1048.1056.1058.1061.1070.1076.1089.1090.1091.1092.1093. 1094.1095.1096.1097.1098.1106.1108.1157.116…