码迷,mamicode.com
首页 >  
搜索关键字:vector    ( 11651个结果
【思维】图论+时间戳——Gym - 102501K 好题
这题非常好。。看似很简单其实比较复杂,交了一堆假算法全wa了。。 看题解也好久才弄明白 /* 给定一张有向图,确定一个点T,问有多少T0,满足所有T0->T的路径,都经过边(T0,T) 建立反图,T变为起点,求所有T0,满足T->T0所有路径都经过(T,T0) 首先确定用bfs,我们从每个和T连边T ...
分类:其他好文   时间:2020-06-14 14:24:22    阅读次数:81
Codeforces Round #628 (Div. 2) F——Ehab's Last Theorem dfs
#include<bits/stdc++.h> #define ls rt<<1 #define rs rt<<1|1 using namespace std; typedef long long ll; const int p=1e8+7; vector<int>v[1001000],ans; i ...
分类:其他好文   时间:2020-06-14 12:35:49    阅读次数:64
PAT高效技巧算法---1040 有几个PAT (25分)
1040 有几个PAT (25分) 和1045快排那个思想很像 左边、右边的分别累加在数组中存入 #include<iostream> #include<vector> #include<cctype> #include<map> #include<set> #include<sstream> #i ...
分类:编程语言   时间:2020-06-14 10:47:12    阅读次数:75
lc739
class Solution {public: vector<int> dailyTemperatures(vector<int>& T) { int n=T.size(); vector<int> t(n); for(int i=0;i<n;i++) for(int j=i+1;j<n;j++) ...
分类:其他好文   时间:2020-06-14 10:33:43    阅读次数:56
PAT高效技巧算法---1045 快速排序 (25分)
1045 快速排序 (25分) 求划分的主元(比左边的都大,右边的都小) #include<iostream> #include<vector> #include<cctype> #include<map> #include<set> #include<sstream> #include<strin ...
分类:编程语言   时间:2020-06-14 10:28:39    阅读次数:66
【思维】迪杰斯特拉升维dp—— swerc Gym - 102501A
老套路了。。 /* 给定起点(xs,ys), 终点(xd,yd), 最大旅程距离B 汽车的每公里代价C0 其余交通方式数量T<=100 其余交通方式代价[C1..CT]<=100 车站数量N<=1000 第i个车站的位置(xi,yi),边数li<=100,每条边(j,mj)表示连向第j个车站,交通方 ...
分类:其他好文   时间:2020-06-14 00:59:41    阅读次数:91
面试题63. 股票的最大利润
面试题63. 股票的最大利润 class Solution { public: int maxProfit(vector<int>& prices) { if(prices.size()<=1) return 0; int ans=prices[0]; int ans1=0; for(int i=1 ...
分类:其他好文   时间:2020-06-13 23:27:12    阅读次数:69
c++中 vector常用方法
本篇中使用的调试函数如下 1 template<typename T> 2 void print_vector(vector<T> a){ 3 if(a.size() == 0) 4 cout << "empty" << endl; 5 else{ 6 for(int i = 0; i < a.si ...
分类:编程语言   时间:2020-06-13 15:56:59    阅读次数:78
Java知识33 集合框架 List接口 Map 和set【多测师】
一、Java集合框架 1.Java提供的特设类如:Dictionary Vector Stack和Properties这些类来储存和操作对象组 2.通过这些接口实现集合如:LinkedList HashSet和TreeSet,集合框架是一个用来代表和操纵集合的同一框架,所有的集合包含如下: 接口:是 ...
分类:编程语言   时间:2020-06-13 00:07:11    阅读次数:62
Codeforces Round #648 (Div. 2) A - Matrix Game
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<cmath> #include<map> #include<vector> #include<queue> #include<set> ...
分类:其他好文   时间:2020-06-12 21:47:06    阅读次数:66
11651条   上一页 1 ... 54 55 56 57 58 ... 1166 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!