
华为oj
文章平均质量分 58
不知取什么昵称
这个作者很懒,什么都没留下…
展开
-
华为oj 称砝码
我的代码 dfs#include #include #include using namespace std;const int MAX_W=10500;bool dp[MAX_W];void dfs(int i,int n,int weight[],int nums[],int sum){ if(i==n) return; for(int k=0;k<=n原创 2015-09-11 14:54:44 · 488 阅读 · 0 评论 -
华为oj 将真分数分解为埃及分数
难点:最简分数分子为3 时 ,要拆成1+2 我也不知道为什么 不拆也有答案 但是不会AC 我也是很多错误才AC的#include //incorrect#include #include #include using namespace std;int gcd(int x,int y){ if(y==0) return x; return gcd(y,x%原创 2015-09-11 15:31:12 · 656 阅读 · 0 评论 -
华为oj 扑克牌大小
先对joker JOKER最大 然后是炸弹 都是炸弹比较第一张牌 你会发现 10 是两个字符 很不和谐 做了预处理 引入临时变量 然后把字符’0‘ eraser ,这样你就会发现(单牌以外的)同种牌型张数都是一样要考虑的就少了代码如下#include #include #include using namespace std;int main(){原创 2015-09-12 19:27:43 · 1139 阅读 · 1 评论 -
华为oj 字符串合并处理
#include #include #include #include #include using namespace std;const int MAX_N=100000;int change[] = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 };int main(){ map m; for(i原创 2015-09-15 20:46:58 · 526 阅读 · 0 评论