摘要: 题目:http://hustoj.sinaapp.com/problem.php?id=1828 * * * x * * ------- * * * * * * ------- * * * *用给定的数字来取代*,求式子成立的个数思路:枚举法,我的做法是将111*11到999*99全部枚举,也可将输入的数字排列枚举。#include <stdio.h>#include <stdlib.h>int arr[10];int ans=0;int n;int inarr(int x){ int num; if(x/100==0) num=2... 阅读全文
posted @ 2012-12-25 15:39 Daniel Qiu 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 题目:http://hustoj.sinaapp.com/problem.php?id=1826用个数固定总长最小的几块木板 覆盖不连续的区间 求木板总长思路:快排 贪心法#include <stdio.h>#include <stdlib.h>int arr[210];int gap[210];int cmp(const void *a,const void *b){ return *(int*)a-*(int *)b;}int main(){ int ans=0; int m,s,c; scanf("%d%d%d",&m,&s,& 阅读全文
posted @ 2012-12-25 00:19 Daniel Qiu 阅读(237) 评论(0) 推荐(0) 编辑