04 2016 档案

Dijkstra 算法
摘要:最短路径算法—Dijkstra(迪杰斯特拉)算法分析与实现(C/C++) Dijkstra(迪杰斯特拉)算法是典型的最短路径路由算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。Dijkstra算法能得出最短路径的最优解,但由于它遍历计算的节点 阅读全文

posted @ 2016-04-30 18:42 Jstyle 阅读(198) 评论(0) 推荐(0)

POJ - 2387 Til the Cows Come Home(Dijkstra)
摘要:题目链接:http://poj.org/problem?id=2387 阅读全文

posted @ 2016-04-30 18:34 Jstyle 阅读(118) 评论(0) 推荐(0)

HDU - 1874 畅通工程续(Dijkstra)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1874 阅读全文

posted @ 2016-04-30 18:30 Jstyle 阅读(113) 评论(0) 推荐(0)

HDU - 3790 最短路径问题(Dijkstra)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3790 阅读全文

posted @ 2016-04-30 18:26 Jstyle 阅读(114) 评论(0) 推荐(0)

HDU - 1548 A strange lift(Dijkstra)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1548 阅读全文

posted @ 2016-04-30 18:23 Jstyle 阅读(134) 评论(0) 推荐(0)

HDU - 2544 最短路(Dijkstra)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2544 阅读全文

posted @ 2016-04-30 18:19 Jstyle 阅读(201) 评论(0) 推荐(0)

西电OJ - 1041 Franky的游戏O
摘要:题目链接:http://acm.xidian.edu.cn/problem.php?id=1041 阅读全文

posted @ 2016-04-27 22:28 Jstyle 阅读(159) 评论(0) 推荐(0)

西电OJ - 1042 另一个简单游戏
摘要:题目链接:http://acm.xidian.edu.cn/problem.php?id=1042 阅读全文

posted @ 2016-04-27 22:21 Jstyle 阅读(351) 评论(0) 推荐(0)

西电OJ - 1035 数独
摘要:题目链接:http://acm.xidian.edu.cn/problem.php?id=1035 阅读全文

posted @ 2016-04-27 22:20 Jstyle 阅读(242) 评论(0) 推荐(0)

USACO 2.1-Healthy Holsteins
摘要:题目链接:http://train.usaco.org/usacoprob2?a=ckp2K41VOuH&S=holstein 阅读全文

posted @ 2016-04-25 17:35 Jstyle 阅读(138) 评论(0) 推荐(0)

USACO 2.1-Sorting a Three-Valued Sequence
摘要:题目链接:http://train.usaco.org/usacoprob2?a=bzdILz0bsTb&S=sort3 阅读全文

posted @ 2016-04-25 16:43 Jstyle 阅读(129) 评论(0) 推荐(0)

HDU - 1501 Zipper
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1501 阅读全文

posted @ 2016-04-24 23:05 Jstyle 阅读(107) 评论(0) 推荐(0)

UVA - 624 CD
摘要:题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=565 阅读全文

posted @ 2016-04-24 23:05 Jstyle 阅读(104) 评论(0) 推荐(0)

HDU - 2126 Buy the souvenirs
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2126 阅读全文

posted @ 2016-04-23 23:29 Jstyle 阅读(124) 评论(0) 推荐(0)

HDU - 2955 Robberies
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2955 阅读全文

posted @ 2016-04-23 23:27 Jstyle 阅读(110) 评论(0) 推荐(0)

HDU - 2546 饭卡
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2546 阅读全文

posted @ 2016-04-21 23:28 Jstyle 阅读(94) 评论(0) 推荐(0)

HDU - 2602 Bone Collector
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602 阅读全文

posted @ 2016-04-21 23:24 Jstyle 阅读(104) 评论(0) 推荐(0)

HDU - 1159 Common Subsequence
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1159 阅读全文

posted @ 2016-04-21 23:19 Jstyle 阅读(119) 评论(0) 推荐(0)

HDU - 2571 命运
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2571 阅读全文

posted @ 2016-04-20 23:07 Jstyle 阅读(124) 评论(0) 推荐(0)

HDU - 1203 I NEED A OFFER!
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1203 #include #include #include using namespace std;/************************************************... 阅读全文

posted @ 2016-04-20 23:06 Jstyle 阅读(112) 评论(0) 推荐(0)

HDU - 1087 Super Jumping! Jumping! Jumping!
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087 阅读全文

posted @ 2016-04-20 23:04 Jstyle 阅读(134) 评论(0) 推荐(0)

HDU - 2084 数塔
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2084 阅读全文

posted @ 2016-04-20 22:14 Jstyle 阅读(127) 评论(0) 推荐(0)

西电网络赛 - G
摘要:#include #include #include using namespace std; /**************************************************************************************************************** 画外音(学神满早上说用贪心,然后想了一天没想出... 阅读全文

posted @ 2016-04-17 21:55 Jstyle 阅读(120) 评论(0) 推荐(0)

西电网络赛 - E
摘要:#include #include #include using namespace std;/****************************************************************************************************... 阅读全文

posted @ 2016-04-17 21:52 Jstyle 阅读(140) 评论(0) 推荐(0)

西电网络赛 - D
摘要:#include using namespace std;/**************************************************************************************************************** ... 阅读全文

posted @ 2016-04-17 21:52 Jstyle 阅读(117) 评论(0) 推荐(0)

西电网络赛 - C
摘要:#include using namespace std;/**************************************************************************************************************** ... 阅读全文

posted @ 2016-04-17 21:50 Jstyle 阅读(126) 评论(0) 推荐(0)

西电网络赛 - B
摘要:#include #include using namespace std;/*************************************************************************************************************... 阅读全文

posted @ 2016-04-17 21:50 Jstyle 阅读(135) 评论(0) 推荐(0)

西电网络赛 - A
摘要:#include using namespace std;/****************************************************************************************************************** ... 阅读全文

posted @ 2016-04-17 21:49 Jstyle 阅读(117) 评论(0) 推荐(0)

HDU - 1016 Prime Ring Problem
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1016 阅读全文

posted @ 2016-04-15 14:58 Jstyle 阅读(105) 评论(0) 推荐(0)

HDU - 2553 N皇后问题
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2553 阅读全文

posted @ 2016-04-14 22:50 Jstyle 阅读(111) 评论(0) 推荐(0)

HDU - 1015 Safecracker
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1015 #include <iostream> #include <stdio.h> #include <algorithm> #include <string.h> #define res(v,w,x, 阅读全文

posted @ 2016-04-14 22:37 Jstyle 阅读(81) 评论(0) 推荐(0)

HDU - 1010 Tempter of the Bone
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1010 阅读全文

posted @ 2016-04-13 15:54 Jstyle 阅读(111) 评论(0) 推荐(0)

BFS - 水题
摘要:#include #include #include using namespace std;/****************************************************************************************************... 阅读全文

posted @ 2016-04-13 14:06 Jstyle 阅读(141) 评论(0) 推荐(0)

cf - #346 C-Tanya and Toys
摘要:#include #include using namespace std; /******************************************************************************************************************* 贪心:排序,水过去... 阅读全文

posted @ 2016-04-12 23:46 Jstyle 阅读(148) 评论(0) 推荐(0)

cf - #346 D-Bicycle Race
摘要:#include #define MAX 1010 using namespace std; /******************************************************************************************************************** 最大的矩形四个顶点肯定不是危险; ... 阅读全文

posted @ 2016-04-12 23:45 Jstyle 阅读(115) 评论(0) 推荐(0)

cf - #346 E-New Reform
摘要:#include #include using namespace std; /**************************************************************************************************************** 题意: 给你一个图... 阅读全文

posted @ 2016-04-12 23:43 Jstyle 阅读(127) 评论(0) 推荐(0)

cf- #346 A-Round House
摘要:#include using namespace std;/**************************************************************************************************************** ... 阅读全文

posted @ 2016-04-12 23:36 Jstyle 阅读(107) 评论(0) 推荐(0)

USACO 2.1-The Castle
摘要:/* ID: m1590291 TASK: castle LANG: C++ */ #include #include #include using namespace std; /**********************************************************************************************************... 阅读全文

posted @ 2016-04-09 14:11 Jstyle 阅读(125) 评论(0) 推荐(0)

借用一下界面
摘要:#include #include #include using namespace std;/****************************************************************************************************... 阅读全文

posted @ 2016-04-08 13:41 Jstyle 阅读(133) 评论(0) 推荐(0)

USACO 1.5-Superprime Rib
摘要:/* ID: m1590291 TASK: sprime LANG: C++ */ #include #include using namespace std; /****************************************************************************************************************** ... 阅读全文

posted @ 2016-04-06 23:50 Jstyle 阅读(114) 评论(0) 推荐(0)

USACO 1.5-Prime Palindromes
摘要:/* ID: m1590291 TASK: pprime LANG: C++ */ #include using namespace std; /****************************************************************************************************************** ... 阅读全文

posted @ 2016-04-06 23:49 Jstyle 阅读(121) 评论(0) 推荐(0)

USACO 1.5-Number Triangles
摘要:/* ID: m1590291 TASK: numtri LANG: C++ */ #include #include #include #include using namespace std; /************************************************************************************************... 阅读全文

posted @ 2016-04-06 23:48 Jstyle 阅读(138) 评论(0) 推荐(0)

USACO 1.4-Mother's Milk
摘要:/* ID: m1590291 TASK: milk3 LANG: C++ */ #include #include #include #define MAX 25 int A,B,C; int ans[MAX]; //涂灰的标志数组 int vis[MAX][MAX][MAX]; //dfs的执行数组 /*********************************... 阅读全文

posted @ 2016-04-06 23:47 Jstyle 阅读(125) 评论(0) 推荐(0)

USACO 1.4-Arithmetic Progressions
摘要:/* ID: 1590291 TASK: ariprog LANG: C++ */ #include #include #include #include /****************************************************************************************************************** ... 阅读全文

posted @ 2016-04-06 00:06 Jstyle 阅读(119) 评论(0) 推荐(0)

USACO 1.3-Ski Course Design
摘要:校赛的题啊,后悔没有早早做了!!!校赛啊!!!那么丰厚的奖品呢!!!唉~省赛加油吧!!! /* ID: 15901291 TASK: skidesign LANG: C++ */ #include <iostream> #include <fstream> #include <algorithm> 阅读全文

posted @ 2016-04-05 22:53 Jstyle 阅读(113) 评论(0) 推荐(0)

USACO 1.3-Wormholes
摘要:此题 copy 别人的,题意都木有读的很懂。这样是不好滴,知识习惯性的更新一下 blog,以后减少这样的行为。代码粘一下,看看别人的代码吧。 阅读全文

posted @ 2016-04-05 22:50 Jstyle 阅读(116) 评论(0) 推荐(0)

USACO 1.3-Prime Cryptarithm
摘要:/* ID: m1590291 TASK: crypt1 LANG: C++ */ #include #include #include using namespace std; /**********************************************************************************************************... 阅读全文

posted @ 2016-04-04 23:06 Jstyle 阅读(147) 评论(0) 推荐(0)

USACO 1.3-Mixing Milk
摘要:/* ID: m1590291 TASK: milk LANG: C++ */ /****************************************************************************************************************** 单价升序排序 -> 按单价购买牛奶花费最小 **********... 阅读全文

posted @ 2016-04-04 23:05 Jstyle 阅读(135) 评论(0) 推荐(0)

USACO 1.3-Combination Lock
摘要:/* ID: m1590291 TASK: combo LANG: C++ */ #include #include #include /****************************************************************************************************************** ... 阅读全文

posted @ 2016-04-04 23:04 Jstyle 阅读(166) 评论(0) 推荐(0)

USACO 1.3-Barn Repair
摘要:/* ID: m1590291 TASK: barn1 LANG: C++ */ #include #include #include #include using namespace std; int main() { int a[205],b[205],M,S,C; ifstream fin("barn1.in"); ofstream fout("barn1.o... 阅读全文

posted @ 2016-04-04 23:03 Jstyle 阅读(120) 评论(0) 推荐(0)

USACO 1.2-Transformations
摘要:/* ID: m1590291 TASK: transform LANG: C++ */ #include #include #include #define MAX 20 using namespace std; int n; char a[MAX][MAX],b[MAX][MAX]; bool check() //检查是否相等 { bool flag=true; for... 阅读全文

posted @ 2016-04-04 23:02 Jstyle 阅读(137) 评论(0) 推荐(0)

USACO 1.2-Palindromic Squares
摘要:/* ID: m1590291 PROG: palsquare LANG: C++ */ #include #include using namespace std; char NUMBER[20] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', .. 阅读全文

posted @ 2016-04-04 23:02 Jstyle 阅读(135) 评论(0) 推荐(0)

USACO 1.2-Name That Number
摘要:/* ID: m1590291 TASK: namenum LANG: C++ */ /****************************************************************************************************************** 一个字母只对应一个数字,从字典中读入一个单词,把它转化成唯一对应的... 阅读全文

posted @ 2016-04-04 23:01 Jstyle 阅读(137) 评论(0) 推荐(0)

USACO 1.2-Milking Cows
摘要:/* ID: m1590291 TASK: milk2 LANG: C++ */ #include <iostream> #include <algorithm> #include <fstream> #define MAX 5005 using namespace std; struct Node 阅读全文

posted @ 2016-04-04 23:00 Jstyle 阅读(124) 评论(0) 推荐(0)

USACO 1.2-Dual Palindromes
摘要:/* ID: m1590291 TASK: dualpal LANG: C++ */ #include #include using namespace std; ifstream fin ("dualpal.in"); ofstream fout ("dualpal.out"); const char a[] = {'0', '1', '2', '3', '4', '5', '6', '7'... 阅读全文

posted @ 2016-04-04 22:58 Jstyle 阅读(115) 评论(0) 推荐(0)

USACO 1.1-ride
摘要:/* ID: m1590291 PROG: ride LANG: C++ */ #include #include using namespace std; int main() { string s1,s2; int sum1=1,sum2=1,i; ifstream fin ("ride.in"); ofstream fout ("ride.out"); ... 阅读全文

posted @ 2016-04-04 22:58 Jstyle 阅读(143) 评论(0) 推荐(0)

USACO 1.1-gift1
摘要:/* ID: m1590291 PROG: gift1 LANG: C++ */ #include #include using namespace std; int main() { ifstream fin ("gift1.in.txt"); ofstream fout ("gift1.out.txt"); int s,i,j,k,money=0,ou... 阅读全文

posted @ 2016-04-04 22:56 Jstyle 阅读(215) 评论(0) 推荐(0)

USACO 1.1-Friday the Thirteenth
摘要:#include #include #include #include int isleap(int y) { return y%4==0 && (y%100 != 0 || y%400 == 0); } int mtab[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; /* return length of m... 阅读全文

posted @ 2016-04-04 22:55 Jstyle 阅读(136) 评论(0) 推荐(0)

USACO 1.1-beads
摘要:/* ID: m1590291 PROG: beads LANG: C++ */ #include #include using namespace std; int main() { int num,max=0,n,i,j,k; char *p,symbol1,symbol2; ifstream fin("beads.in"); ofstream fout("beads.out... 阅读全文

posted @ 2016-04-04 22:52 Jstyle 阅读(129) 评论(0) 推荐(0)

导航