码迷,mamicode.com
首页 >  
搜索关键字:algorithm    ( 11758个结果)
POJ 2187 Beauty Contest
题意: "题目链接" 给定 $n$ 个点,求距离最远的两个点之间的距离,输出最远距离的平方 $n include using namespace std; const int N=50005; int n,top,per[N],res; struct point{int x,y;int dist() ...
分类:其他好文   时间:2020-01-22 13:15:14    阅读次数:58
pta—紧急救援 (dijkstra)
题目连接:https://pintia.cn/problem-sets/994805046380707840/problems/994805073643683840 题面: 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救 ...
分类:其他好文   时间:2020-01-22 11:13:28    阅读次数:190
PTA乙级 (1059 C语言竞赛 (20分)(map.find()、vector中的find))
一、vector中的find 注意find不属于vector的成员,而存在于算法中,应加上头文件#include <algorithm> 1 #include <vector> 2 #include <algorithm> 3 #include <iostream> 4 using namespac ...
分类:编程语言   时间:2020-01-22 01:04:09    阅读次数:110
E - Arctic Network
E - Arctic Network The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communica ...
分类:Web程序   时间:2020-01-21 23:45:57    阅读次数:125
完全背包问题
#include<iostream> #include<algorithm> using namespace std; int m,n,w[31],c[31],f[31][201],p; int main(){ cin>>m>>n; for(int i=1;i<=n;i++) cin>>w[i]>> ...
分类:其他好文   时间:2020-01-21 23:12:33    阅读次数:110
二叉树遍历 ——已知后序,中序求层序 A1020.(25)
若直接DFS递归求解,会栈溢出 #include <cstdio> #include <cstring> #include <queue> #include <algorithm> using namespace std; const int maxn=50; struct node{ int da ...
分类:其他好文   时间:2020-01-21 23:11:32    阅读次数:76
Codeforces Round #563 (Div. 2)B;Ehab Is an Odd Person
原文链接:任意门 题目大意:给你一组数,让你交换两个数的位置,让它们的和为奇数,且使其交换后,顺序满足最小字典序列。思路:这就是一道狗题,看代码,你就会******了,只需要sort排序。代码: 1 #include"iostream" 2 #include"algorithm" 3 #includ ...
分类:其他好文   时间:2020-01-21 22:00:33    阅读次数:89
Codeforces Round #563 (Div. 2)C. Ehab and a Special Coloring Problem
原文链接:传送门思路:素数筛代码: 1 #include"iostream" 2 #include"algorithm" 3 #include"cstring" 4 using namespace std; 5 long long a[2000006],n; 6 int main(){ 7 cin> ...
分类:其他好文   时间:2020-01-21 21:44:48    阅读次数:89
Codeforces Global Round 3:B. Born This Way
Born This Way原文链接:[传送门] 题目大意:潇洒哥想乘坐飞机从A地到达C地,但是没有直达的航班,在A地和B地之间有一个可以中转的航班B,潇洒哥想早点到达C地(有航班就坐),但是很不幸他得罪了大魔王黑大帅,他可以取消潇洒哥的航班有k次机会(毕竟费蓝)让潇洒哥最迟到达,现在给你n,m,ta ...
分类:其他好文   时间:2020-01-21 21:40:39    阅读次数:71
ACM HDU 1166 敌兵布阵 简单的线段树 求区间和
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1166 AC代码 #include<iostream> #include<string> #include <algorithm> #include<cstring> #include<cstdio> us ...
分类:其他好文   时间:2020-01-21 20:01:19    阅读次数:75
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!