![](https://img-blog.csdnimg.cn/20200321003131461.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
算法竞赛入门经典训练指南
刘汝佳著《算法竞赛入门经典训练指南》习题。根据在ACM队伍中的分工可能主要是写第一章和第二章,部分第六章
STL_CC
数据科学,数学建模,ACM,机器学习,边缘计算。
展开
-
深度学习图形工作站环境安装与配置(1)CUDA和cuDNN的安装
介绍笔者的图形工作站基于Ubuntu 18.04,请先安装Ubuntu操作系统。推荐安装Ubuntu 18.04 LTS,LTS意味着Long Term Support,你可以在官网下载并刻录U盘安装。Ubuntu操作系统官网下载,可以看到该系统支持到2023年4月,是较为稳定的版本。显卡驱动的安装如果你确定你的显卡驱动被正确的安装了,可以跳过这一步在刚装好Ubuntu操作系统时,默认的显...原创 2020-04-13 13:54:20 · 1545 阅读 · 0 评论 -
第一章-问题求解策略-Uva11134-Fabled Rooks
分类:思维题目链接:Uva11134-Fabled Rooks那个定义运算符<的地方,如果改成这样就错了,不知道神马原因bool operator < (const node &rhs) const{ if (l != rhs.l) return l > rhs.l ; return r > rhs.r ;}先按行放,再看看列满不满足即...原创 2020-03-26 21:41:33 · 171 阅读 · 0 评论 -
第一章-问题求解策略-LA3507-Keep the Customer Satisfied
分类:贪心题目链接:LA3507-Keep the Customer Satisfied开始在POJ上看到LA上一模一样的题面,最终发现其实POJ上的那个没有多组测试用例,不用输入T#include<algorithm>#include<queue>#include<cstdio>using namespace std;const int maxn...原创 2020-03-25 18:46:02 · 308 阅读 · 0 评论 -
第一章-问题求解策略-LA2757-Supermarket
分类:贪心题目链接:LA2757-Supermarket#include<bits/stdc++.h>using namespace std;const int maxn=1e4+10;struct node{ int p,d; friend bool operator < (node a,node b) { return a....原创 2020-03-25 17:14:16 · 184 阅读 · 0 评论 -
第一章-问题求解策略-Uva10970-Big Chocolate
分类:思维,简单数学题目链接:Uva10970-Big Chocolate找规律,答案就是m*n-1#include<iostream>using namespace std;int main(){ int m,n; while(cin>>m>>n) { cout<<m*n-1<<end...原创 2020-03-25 15:50:03 · 204 阅读 · 0 评论 -
第一章-问题求解策略-Uva10340-All in All
分类:简单字符串题目链接:Uva10340-All in All水题,按要求做即可#include<iostream>#include<cstring>#include<string>#include<algorithm>#include<cstdio>using namespace std;const int maxn...原创 2020-03-25 15:47:22 · 158 阅读 · 0 评论 -
第一章-问题求解策略-Uva10382-Watering Grass
分类:贪心题目链接:Uva10382-Watering Grass经典的区间贪心(1) 选择不相交区间 【问题描述】数轴上有n个开区间(ai, bi)。选择尽量多的区间,使这些区间两两没有公共点。【贪心策略】按bi从小到大的顺序排序,然后一定选择第一个区间。接下来把所有与第一个区间相交的区间排除在外。这样在排序后再扫描一遍即可。(2) 区间选点问题 【问题描述】数轴上有n个闭区间[ai...原创 2020-03-25 15:43:34 · 168 阅读 · 0 评论 -
第一章-问题求解策略-Uva10905-Children's Game
分类:贪心题目链接:Uva10905-Children’s Game#include<iostream>#include<cstring>#include<string>#include<algorithm>using namespace std;const int maxn=100+5;string s[maxn];int n;...原创 2020-03-25 15:38:55 · 182 阅读 · 0 评论 -
第一章-问题求解策略-LA4254-Processor
分类:二分答案题目链接:LA4254-Processor这个题目如果在某一秒上一个任务已经执行完了,是可以继续执行下一个任务的,这个check函数相对来说比较难想#include<bits/stdc++.h>using namespace std;const int maxn=1e5+10;struct node{ int l,r,w; friend bo...原创 2020-03-25 15:35:32 · 185 阅读 · 0 评论 -
第一章-问题求解策略-Uva11627-Slalom
分类:二分答案题目链接:Uva11627-Slalom该题自4年前有提交通过的后,再也没有人能提交通过,应该是oj的问题,这里的代码能过样例(当然估计也能过题)#include<bits/stdc++.h>#define mem(x) memset(x,0,sizeof(x))using namespace std;const int maxn=1e6+10;const ...原创 2020-03-25 04:01:49 · 251 阅读 · 0 评论 -
第一章-问题求解策略-Uva11100-The Trip, 2007
分类:思维题目链接:Uva11100-The Trip, 2007多找几个例子,发现答案就是形同的数的最多有多少个#include<cstdio>#include<cstring>#include<algorithm>#define mem(x) memset(x,0,sizeof(x));using namespace std;const in...原创 2020-03-23 18:43:14 · 168 阅读 · 0 评论 -
第一章-问题求解策略-LA4725-Airport
分类:二分答案题目链接LA4725-Airport注意check函数的写法,其他的跟普通二分法无异,这里的check函数写法是一个亮点可以看看模板三种常见的二分答案模板#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespa...原创 2020-03-23 15:08:22 · 213 阅读 · 0 评论 -
第一章-问题求解策略-LA4850-Installations
分类:贪心题目链接:LA4850-Installations按d排序,若d同,则按s排序#include<iostream>#include<cstdio>#include<algorithm>using namespace std;const int maxn=500+5;struct node{ int s,d;}a[maxn];...原创 2020-03-23 14:48:55 · 211 阅读 · 0 评论 -
第一章-问题求解策略-LA3266-Tian Ji -- The Horse Racing
分类:贪心题目链接:LA3266-Tian Ji – The Horse Racing经典贪心问题【问题描述】大家都知道“田忌赛马”的故事。现在,田忌再一次和齐王赛马。他们各派出N匹马(N≤2000)。每场比赛,输的一方将要给赢的一方200两黄金,如果是平局的话,双方都不必拿出钱。每匹马的速度值是固定而且已知的,而齐王出马也不管田忌的出马顺序。请问田忌该如何安排自己的马去对抗齐王的马,才...原创 2020-03-23 14:43:14 · 181 阅读 · 0 评论 -
第一章-问题求解策略-Uva11389-The Bus Driver Problem
分类:贪心题目链接:Uva11389-The Bus Driver Problem下午大的配晚上小的#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn=100+5;int a[maxn],b[maxn];bool cp(co...原创 2020-03-23 14:35:24 · 224 阅读 · 0 评论 -
第一章-问题求解策略-LA3303-Songs
分类:思维题目链接:LA3303-Songs对于某两首歌曲song[i]+song[i+1],差别只有l[i]*f[i+1]或l[i+1]*f[i]按这个排序即可#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=1e6+10;struct node{ ll...原创 2020-03-23 14:32:37 · 163 阅读 · 0 评论 -
第一章-问题求解策略-LA4094-WonderTeam
分类:思维题目链接:LA4094-WonderTeam打表找规律#include<cstdio>using namespace std;int main(){ int n; while(scanf("%d",&n)&&n) { if(n<=3) { printf("...原创 2020-03-23 14:25:27 · 174 阅读 · 0 评论 -
第一章-问题求解策略-LA4234-Binary Clock
分类:二进制转换题目链接:LA4234-Binary Clock就是转换成二进制,然后按需求输出即可#include<bits/stdc++.h>#define mem(x) memset(x,0,sizeof(x));using namespace std;int h,m,s,T;int a[10],b[10],c[10];void convert(int x,int...原创 2020-03-23 09:08:28 · 185 阅读 · 0 评论 -
第一章-问题求解策略-LA4238-Area of Polycubes
分类:思维题目链接:LA4238-Area of Polycubes开始想到搜索,结果炸了,后来发现是判断距离如果两者之间距离为1,则面积减少2如果两者距离为0,显然出现了错误如果某个立方块与其他块距离总是非0或1,即不接触,则出错#include<bits/stdc++.h>#define mem(x) memset(x,0,sizeof(x))using names...原创 2020-03-21 17:38:14 · 187 阅读 · 0 评论 -
第一章-问题求解策略-LA4636-Cubist Artwork
分类:思维题题目链接:LA4636-DNA Consensus String正视图和侧视图最多的那个#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn=100+5;int num1[maxn],num2[maxn];int ...原创 2020-03-21 15:30:35 · 265 阅读 · 0 评论 -
第一章-问题求解策略-LA3602-DNA Consensus String
#include<iostream>#include<cstring>#include<string>#include<map>using namespace std;const int maxn=1000+50;const int maxm=50+5;char s[maxm][maxn];char ans[maxn];char ...原创 2020-03-08 22:41:51 · 290 阅读 · 0 评论 -
第一章-问题求解策略-LA3213-Ancient Cipher
#include<iostream>#include<cstdio> #include<algorithm>#include<cstring>using namespace std;char a[105],b[105];int ca[30],cb[30];void init(){ memset(ca,0,sizeof(ca));...原创 2020-03-08 22:39:09 · 178 阅读 · 0 评论 -
第一章-问题求解策略-Uva11039-Building designing
#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn=500000+50;int arr[maxn];bool cp(const int &a,const int &b){ return abs(a)&l...原创 2020-03-08 22:35:58 · 200 阅读 · 0 评论 -
第一章-问题求解策略-Uva11636-Hello World!
#include<iostream>using namespace std;int n,t=1;int a[1005];int main(){ ios::sync_with_stdio(false); a[1]=2; for(int i=2;i<=1000;i++) { a[i]=a[i-1]*2; } w...原创 2020-03-02 13:51:16 · 223 阅读 · 0 评论