摘要: 可以推出规律 每一个数第一次出现的位置 和 n*10后出现的位置 要特殊考虑 是10的倍数的情况(10,100,1000, .......) 它的位置是不会改变的#include#define uLL unsigned long longusing namespace std;uLL a[30] =... 阅读全文
posted @ 2013-08-05 16:43 xlc2845 阅读(126) 评论(0) 推荐(0)
摘要: 推出公式 然后特判两端 代码其实挺烂 但是有人竟然可以直接暴过去的 ......#include #include #include #include using namespace std;int main(){ double A,B; int c; scanf("%lf%l... 阅读全文
posted @ 2013-08-05 12:50 xlc2845 阅读(122) 评论(0) 推荐(0)
摘要: 本来就是个很水的题 就是枚举起点长度然后直接判断就行了 但是比赛的时候写了个大bug 还找不出来 自己太水了#include #include using namespace std;int g[110][110];int findd(int len, int x, int y){ in... 阅读全文
posted @ 2013-08-05 12:46 xlc2845 阅读(137) 评论(0) 推荐(0)
摘要: 最小生成树 第一次敲 套用几个函数 其实挺容易的#include #include #include #include using namespace std;struct node{ int u,v,w; void f(int a, int b, int c) { ... 阅读全文
posted @ 2013-08-04 16:16 xlc2845 阅读(142) 评论(0) 推荐(0)
摘要: 题意:如果数列中没有三个元素的子序列构成等差数列输出yes 不然no标记每个数出现的位置 然后从0开始寻找三个元素的等差数列 如果这三个元素的位置满足条件则原数列中存在等差数列#include#includeint n,num[10010];int main(){ int n; whil... 阅读全文
posted @ 2013-08-04 12:14 xlc2845 阅读(147) 评论(0) 推荐(0)
摘要: 就是对距离进行二分找最大值 ....#include #include #include #include using namespace std;int a[100010];int n,C;bool can(int lim){ int d = 0,w = 1; for(int i = ... 阅读全文
posted @ 2013-08-03 16:45 xlc2845 阅读(111) 评论(0) 推荐(0)
摘要: 额 一个贪心 好难想到 ......#include #include #include #include using namespace std;int a[1010];int b[1010];int flag1,flag2,flag3,flag4;int main(){ int n; ... 阅读全文
posted @ 2013-08-03 16:16 xlc2845 阅读(118) 评论(0) 推荐(0)
摘要: 将每一个分解为六个两面的 简单地dp 回溯输出路径.....#include #include #include #include using namespace std;struct cc{ int top,bom,fa,w; void f(int a, int b, int c, i... 阅读全文
posted @ 2013-08-03 14:39 xlc2845 阅读(142) 评论(0) 推荐(0)
摘要: dp还是比较容易 关键是输出路径 ....#include #include #include #define inf 0x7fffffffusing namespace std;int n;struct cc{ int a; int b; void f(int x, int y)... 阅读全文
posted @ 2013-08-02 16:51 xlc2845 阅读(97) 评论(0) 推荐(0)
摘要: 题意:删除一棵树上的叶子 每删除一片叶子就写下连着该片叶子的节点 让你还原一棵树记录每个节点连着的叶子数 0表示此时这个节点就是叶子 -1表示这个节点已经删除 删除的只能是0 就是说是叶子 暴力一下就好了#include #include #include #include using namesp... 阅读全文
posted @ 2013-08-02 15:32 xlc2845 阅读(140) 评论(0) 推荐(0)