- 博客(29)
- 资源 (3)
- 收藏
- 关注
原创 hdu 5402 Travelling Salesman Problem
运行这些测试数据都对,但就是wa //4 4//2 3 3 3//3 3 3 3//3 3 3 3//3 3 3 2//answer://43//DRRURDDLLLDRRR////4 4//2 1 3 3//3 3 3 3//3 3 3 3//3 3 3 2//answer://43//DRRURDDLLLDRRR
2015-08-29 10:19:46 645
原创 随机组队_第一场
感觉自己思维很不严谨,问题想得过于简单,或者过于复杂(一般过于复杂的都是没有思路的。。。。)组队一共三人,需要发挥队员各自的优势,比如开始时候,每个人分配一定的题进行解答,一个人正着读题,一个人倒着读,一个人从中间读,如果看到别人很快就a了一道题,那么就分配一个人去a那道题,而其他人继续读题,把题目看一遍,并记录每个题的难度和考察方向,也可以不先易后难,几个人每个人看一道,先写那些看着不算
2015-08-27 14:58:21 763
原创 CodeForces 339D Xenia and Bit Operations 线段树
用线段树,关键点在于,一般用线段树时,先建树、再更新、再查询。而这种方法把它们综合在一起!!!别人的代码。。。。。。。~_~#include#includeusing namespace std;int sign[1 void update(int o, int l, int r,int p, int v, bool t){ int M = (l
2015-08-26 21:27:52 788
原创 poj 1321 棋盘问题 dfs
这道题并不是很难,但由于惯性思维,会考虑dirx[]、diry[]进行位置的点变换,但发现这样子并不很容易就能递归出来。这一题用的行列变换,这道题的价值就在于开拓思维,并不在于难度。#include#include#includeusing namespace std;const int maxn = 10;char maps[maxn][maxn];int vis[m
2015-08-26 21:25:13 671
原创 HDU2795 Billboard 线段树
开始的代码,暴力求解。。。。。果断超时#include #include #include using namespace std;const int maxn = 200005;int main(){ int h, w, k, b; int a[maxn] ; bool flag; while(scanf("%d
2015-08-26 15:12:42 581
原创 常见错误
runtime error (运行时错误)就是程序运行到一半,程序就崩溃了。比如说:①除以零②数组越界:int a[3]; a[10000000]=10;③指针越界:int * p; p=(int *)malloc(5 * sizeof(int)); *(p+1000000)=10;④使用已经释放的空间:int * p; p=(int *)malloc(5
2015-08-25 08:41:53 651
原创 hdu1233 还是畅通工程 prim
#include #include #include using namespace std;const int maxn = 105;const int INF = 0xffffff;struct Node{ int vex,weight; Node(int _vex = 0,int _weight = 0) : vex(_vex),weigh
2015-08-23 22:12:13 690
原创 poj 2349 Arctic Network
————————————————————————————————————————————————~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~————————————————————————————————————————————————这是别人的代码,
2015-08-23 16:25:00 691
原创 hdu 5417 Victor and Machine
有的是直接简单模拟,我的方法是推公式,1,n==1 时直接输出 2,w > x ,w == x, w #includeint main(){ int x, y, w, n; int k, sumt, a, b; while(scanf("%d%d%d%d", &x, &y, &w, &n) != EOF){
2015-08-22 23:40:05 800
原创 hdu1698Just a Hook
线段树区间更新 菜鸟之伤 __int64!!!!#include#include#includeusing namespace std;const int maxn = 100050;struct Tree{ int l, r, setv, sum;}tree[maxnint n;__int64 sumn;void
2015-08-21 16:40:03 586
原创 poj 3468 Simple Problem with Integers
线段树的区间修改开始时套模板, 没做出来,runtime error, 找了许久错误,发现是数据类型应该用long long 。。。。~_~| |。。#include#includeusing namespace std;const int maxm = 100005;struct Tree{ int l; int r; long long s
2015-08-21 16:31:00 517
原创 hdu 1061 Rightmost Digit
暴力解决不了问题,有规律可循, 只需看末尾数字即可, 末尾数字的 n 次方是有规律的#includeusing namespace std;int main(){ int n; int t; while(scanf("%d",&t) != EOF){ while(t--){ scanf("%d", &n);
2015-08-21 08:10:00 843
原创 暑假集训第四周第一练
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88591#problem/A第一题:并不难,当时没读懂题意。。。。第二题:我的first blood。数学题 第三题:没读懂题意,没读懂题意。。。第四题:并查集,不难第五题:求质数,算是数学题吧,不难第六题:是道几何问题,问在两个矩形在不重叠的情况下,能
2015-08-19 21:06:26 394
原创 uva11040
这是道数学题, 并不难 例如:3 ? 3 ? 5 ? 2b c ? ? ? ? ? ?2 a 1 ? 2 ? 1 ? 1 ?怎么确定a? 有个等式3=b+c , b = 2 + a , c = 1 + a 由此得到 3 = 2 + 1 + 2 *a ,可解得 a。同理 可得 其他未知项#include#include#inc
2015-08-19 17:34:11 756
转载 SPFA算法
SPFA算法SPFA(Shortest Path Faster Algorithm)(队列优化)算法是求单源最短路径的一种算法,在Bellman-ford算法的基础上加上一个队列优化,减少了冗余的松弛操作,是一种高效的最短路算法。简 称SPFA全 称Shortest Path Faster Algori
2015-08-14 11:07:50 574
转载 km算法
先说KM算法求二分图的最佳匹配思想,再详讲KM的实现。【KM算法求二分图的最佳匹配思想】对于具有二部划分( V1, V2 )的加权完全二分图,其中 V1= { x1, x2, x3, ... , xn }, V2= {y1, y2, y3, ... , yn },边具有权值 Wi,j。该带权二分图中一个总权值最大的完美匹配,称之为最佳匹配。 记 L(x) 表示结点 x的
2015-08-14 10:31:31 2540
原创 HDU1879 继续畅通工程
把状态为1的权重都改为0,之后prim()就可以了。#include#include#include#includeusing namespace std;const int maxn = 105;const int INF = 1 struct Node{ int vex, weight, state; Node(int
2015-08-13 08:02:26 585
原创 hdu1596 find the safest road
n 次爆表,还是找到了错误,原来是把Floyd()写在循环体里了。。。。不足之处,多多指教。14481443 2015-08-12 17:12:05 Accepted 1596 3588MS 15960K 1010 B C++ #include#include#include#includeusing name
2015-08-12 17:19:04 680
原创 HDU1162
我的思路 将所有点两两相连, 转化成线段 ,再用克鲁斯卡尔#include#include#include#include#includeusing namespace std;const int maxn = 105;const int maxm = 5010;struct Point{ double x, y; Point
2015-08-12 16:34:18 612
原创 HDU1272 小希的迷宫
//先判断是否能成为一棵树,没有多余的节点//在判断是否生成环 //解决第一个问题,直接合并//解决第二个问题,查找 #include#include#includeusing namespace std;const int maxn = 100010;struct Edge{ int v1, v2; Edge(int _v1 =
2015-08-11 21:28:25 409
原创 HDU1301 Jungle Roads
#include#include#include#include#includeusing namespace std;const int maxn = 30;const int maxm = 500;struct Edge{ int v1, v2; int weight; Edge(int _v1 = 0 , int _v2
2015-08-11 17:35:15 388
原创 HDU1233畅通工程
#include#include#include#includeusing namespace std;const int maxn = 105;const int maxm = 50005;struct Edge{ int v1, v2, weight; Edge(int v1=0, int v2=0, int weight=0):v1(v
2015-08-10 22:28:01 362
原创 HDU1429 胜利大逃亡
这道题用的是广搜,状态压缩,起初不理解状态压缩是怎么回事,一个点可以被访问多次,怎么就还能找到最短路径?现在有所顿悟,每到达一种新的状态就是一个新的开始(把它看作又一个起点),那么用广搜,起点到终点,是可以找到最短路径的。#include #include #include using namespace std;char grap[25][
2015-08-09 19:09:36 540
原创 HDU 2128 Tempter of the Bone II
这是一道搜索的题目,不算太难,思路和其他搜索题目一样用广搜 , 起初考虑问题时简单的把所有找过的点都标记为1, 问题来了当找到钥匙时没有办法返回,于是考虑取消标记, 虽然样例可以输出,但明显很占内存,因为每个点可以被重复访问,由此可见还是要标记的,问题是怎么标记。 首先想到的是访问过的依旧标记为1,有炸药时可以通过,没炸药时不能通过,虽然比开始时减少了一定访问量,但依旧很占内存
2015-08-09 16:08:48 632
原创 uva 1368 DNA序列
这是道水题 %s 输出是从第一个位置开始读, 遇'0'结束!所以在存str 是 j-1 , 而不是j #include#includeint main(){ int n, m, t; char maps[55][1005]; char str[1005], ch[5] = { '0', 'A', 'C', 'G',
2015-08-09 13:46:58 746
原创 UVA232 纵横字的解答
不管如何还是纪念一下!花费了将近2个小时,却还是wa。。。不说什么了和样例输出一样, 不知道是哪里出了错。。。#include#includeint main(){ int n, m, coun, k=0; char maps[15][15]; int numap[15][15]; memset(numap,0,sizeo
2015-08-09 11:32:36 484
原创 HDU2036
是道水题题意 : 给出按逆时针排序的n个整数点,求所围成多边形的面积思路 : 进行分割,利用有向面积计算#include //(x0,y0), (x1,y1), (x2, y2)是逆时针返回值为正,顺时针返回值为负 double area(double x0, double y0, double x1,double y1,
2015-08-09 09:29:49 2752
kaggle-dataset sentiment-analysis-on-movie-reviews
2020-08-05
etc目录详解
2017-01-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人