算法入门第八章
刘汝佳算法竞赛入门经典
小刀刺大熊
这个作者很懒,什么都没留下…
展开
-
第八章习题未完成
有时间在做习题8-24(uva-10366)习题8-26(uva-12559)习题8-27(uva-1580)习题8-28(uva-1624)原创 2021-06-06 20:37:17 · 196 阅读 · 0 评论 -
习题8-25(uva-11175)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-06-06 17:27:05 · 94 阅读 · 2 评论 -
习题8-23(uva-1623)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-06-06 15:47:33 · 60 阅读 · 0 评论 -
习题8-22(uva-1622)
#include<cstdio>#include<algorithm>#define REP(i, a, b) for(int i = (a); i < (b); i++)using namespace std;typedef long long ll; ll solve(ll x, ll y, ll n, ll s, ll w, ll e){ ll res = 0; if(s > n) swap(s, n); if(e > w) swap(e,转载 2021-06-04 22:37:33 · 98 阅读 · 0 评论 -
习题8-21(uva-1621)
1.当只有a时,一直一步一步往前走.2.只有a,b时, 先一直用知道a = 1(b % 2 == 0) 往右走 b/2 2步 , 再往右走 a 1步 ,往左走 b/2 2步(b % 2 == 1) 往右走 (b+1)/2 2步 , 往左一步 ,往 左走 b/2 步3.(c % 3 == 0)往右走 c/3 3步,往右走1 1步,往左走 c/3 3步,往右走1 1步,往右走c/3 3步,(c % 3 == 1)往右走 c/3 + 1 3步,往左走1 2步,往左走 c/3 3步,往右走1 1原创 2021-06-02 21:47:36 · 112 阅读 · 0 评论 -
习题8-20(uva-1620)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-31 21:24:16 · 61 阅读 · 0 评论 -
习题8-19(uva-1312)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-30 22:27:23 · 84 阅读 · 0 评论 -
习题8-18(uva-1619)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-29 15:09:34 · 62 阅读 · 0 评论 -
习题8-17(uva-11536)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-29 13:57:06 · 68 阅读 · 0 评论 -
习题8-16(uva-1618)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-29 11:04:15 · 103 阅读 · 0 评论 -
习题8-15(uva-1617)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-25 21:29:48 · 81 阅读 · 0 评论 -
习题8-14(uva-1616)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-24 20:50:16 · 65 阅读 · 0 评论 -
习题8-13(uva-10570)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-23 15:32:23 · 67 阅读 · 0 评论 -
习题8-12(uva-1153)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-21 21:43:10 · 57 阅读 · 0 评论 -
习题8-11(uva-1615)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-21 20:51:25 · 73 阅读 · 0 评论 -
习题8-10(uva-1614)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-19 21:47:24 · 61 阅读 · 0 评论 -
习题8-9(uva-1613)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-18 21:28:13 · 65 阅读 · 0 评论 -
习题8-8(uva-1612)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-16 20:36:41 · 73 阅读 · 0 评论 -
习题8-7(uva-11925)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-16 18:33:54 · 90 阅读 · 0 评论 -
习题8-6(uva-1611)
1.冒泡,依次选1-n2.先把当前选择的数 放在前半部分(保证下一步能把当前数放在前面)#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>原创 2021-05-15 17:43:48 · 88 阅读 · 0 评论 -
习题8-5(uva-177)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-14 00:36:23 · 79 阅读 · 0 评论 -
习题8-4(uva-11491)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-05 17:16:39 · 69 阅读 · 0 评论 -
习题8-3(uva-12545)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-05 16:25:57 · 82 阅读 · 0 评论 -
习题8-2(uva-1610)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-05 13:58:19 · 86 阅读 · 0 评论 -
习题8-1(uva-1149)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-04 20:16:27 · 67 阅读 · 0 评论 -
例题8-19(uva-12265)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-09 20:01:51 · 67 阅读 · 0 评论 -
例题8-18(uva-1442)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-04 19:03:09 · 62 阅读 · 0 评论 -
例题8-17(uva-1609)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-04 18:41:51 · 78 阅读 · 0 评论 -
例题8-16(uva-1608)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-01 15:22:40 · 64 阅读 · 0 评论 -
例题8-15(uva-12174)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-05-01 12:35:48 · 74 阅读 · 0 评论 -
例题8-14(uva-1607)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-28 22:03:40 · 83 阅读 · 0 评论 -
例题8-13(uva-11093)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-25 21:06:24 · 54 阅读 · 0 评论 -
例题8-12(uva-12627)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-21 22:18:59 · 64 阅读 · 0 评论 -
例题8-11(uva-10954)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-18 16:57:51 · 69 阅读 · 0 评论 -
例题8-10(uva-714)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-18 16:47:17 · 73 阅读 · 0 评论 -
例题8-9(uva-1451)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-18 15:51:31 · 71 阅读 · 0 评论 -
例题8-8(uva-1471)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-14 23:08:21 · 85 阅读 · 0 评论 -
例题8-7(uva-11572)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-13 20:39:54 · 58 阅读 · 0 评论 -
例题8-6(uva-1606)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-11 21:26:26 · 73 阅读 · 0 评论 -
例题8-5(uva-11054)
#include <iostream>#include <istream>#include <sstream>#include <vector>#include <stack>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include <cstring>原创 2021-04-04 15:37:59 · 67 阅读 · 0 评论