摘要: 题意:贪心,排序后大数与小数相加具体代码:#include #include #include #include #include using namespace std;#define maxn 100005int n, m;int f[maxn];int cmp(int a, int b){ ... 阅读全文
posted @ 2014-05-17 22:17 903SW-BAO 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题意:模拟题,用字母模拟数字,没有数字代表的则跳过,有数则代表但是连续多组的只输出一个。具体代码:#include#include#includeusing namespace std;int zimu[26]={0,1,2,3,0,1,2,0,0,2,2,4,5,5,0,1,2,6,2,3,0,1... 阅读全文
posted @ 2014-05-17 21:58 903SW-BAO 阅读(169) 评论(0) 推荐(0) 编辑
摘要: escriptionThenthTriangularnumber,T(n) = 1 + … +n, is the sum of the firstnintegers. It is the number of points in a triangular array withnpoints on si... 阅读全文
posted @ 2014-05-17 21:32 903SW-BAO 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 题意很好理解具体思路:3 4 6 9 4 5 7 1 5 8 2 6 3 7 8看成是34 56 7 89 1 2 34 5 6 7 8再做就可以了,就是数字变换的时候需要%10控制一下具体代码:#include#include#includeusing namesp... 阅读全文
posted @ 2014-05-17 20:48 903SW-BAO 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 题意:输入一个N和B N为牛的个数,B为高度,然后输入N头牛,为最少多少头牛加起来高度大于B解题思路:排序,贪心具体代码:#include#include#includeusing namespace std;int main(){ int n,b; int num[20005]; ... 阅读全文
posted @ 2014-05-17 18:38 903SW-BAO 阅读(189) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;int main(){ int t; string s; cin>>t; while(t--) { cin>>s; int ls=s.le... 阅读全文
posted @ 2014-05-17 18:24 903SW-BAO 阅读(123) 评论(0) 推荐(0) 编辑
摘要: reverse();#include#include#include#include#includeusing namespace std;string s1,s2;bool ok(string ss1,string ss2){ int i=0,j=0; while(ss1[i]!='\... 阅读全文
posted @ 2014-05-17 18:12 903SW-BAO 阅读(286) 评论(0) 推荐(0) 编辑