01 2020 档案
摘要:// #include<iostream> #include<cstring> #include<queue> #include<stack> #include<stdio.h> using namespace std; const int INF=0x3f3f3f3f; const int N=3
阅读全文
摘要:#include<iostream> #include<algorithm> #include<cstring> #include<cmath> using namespace std; #define x first #define y second const int N=210; typede
阅读全文
摘要:#include<stdio.h> #include<string.h> #include<iostream> using namespace std; const int N=30; int map[N][N]; bool vis[N]; void Prim(int n) { int len=0,
阅读全文
摘要:#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=110; int p[N],n,m,ans,num; struct node { in
阅读全文
摘要:#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; const int N=510,M=10010; int
阅读全文
摘要:#include<iostream> #include<stdio.h> #include<cstring> #include<queue> using namespace std; typedef pair<int,int>PII; //原地图 char g[100][100]; int n,m;
阅读全文
摘要:#include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=110; #define inf 1<<29 int map[N][N],n; int dist[N]; bool st[N]
阅读全文
摘要:#include<iostream> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; const int maxn=800; int n,m,tot,u,v; int pre[maxn]; //存点
阅读全文
摘要:#include<cstring> #include<iostream> #include<algorithm> #include<cmath> #include<cstdio> #define x first #define y second using namespace std; typede
阅读全文
摘要:#include<iostream> #include<cstring> #include<algorithm> #include<stdio.h> using namespace std; const int INF=0x3f3f3f3f; const int N=2010; int n; int
阅读全文
摘要:#include<iostream> #include<algorithm> using namespace std; const int N=1e6+10; struct edge{ int a,b; double w; }e[N]; int p[N]; int a[N]; int n; bool
阅读全文
摘要:#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=110; int p[N]; struct edge{ int a; int b; int w; }e[N*N]; in
阅读全文
摘要:#include<iostream> #include<cmath> #include<algorithm> #include<cstdio> using namespace std; const int N=1e5; struct edge{ int a,b; double w; }e[N]; d
阅读全文
摘要:#include<iostream> #include<cstring> #include<queue> using namespace std; const int N=1e6; int h[N],e[N],ne[N],w[N]; int n,m; int idx; bool st[N]; int
阅读全文
摘要:#include<math.h> #include<iomanip> //setprecision头文件 #include<stdio.h> #include<iostream> #include<algorithm> #include<string.h> #include<queue> using
阅读全文
摘要:#include<iostream> #include<algorithm> #include<queue> #include<map> #include<cstring> #include<cstring> #include<cstdio> #include<math.h> using names
阅读全文
摘要:#include<iostream> #include<queue> #include<cstring> using namespace std; const int N=200000+10,INF=0x3f3f3f3f; int h[N],e[N],ne[N],w[N],idx; int n,m,
阅读全文
摘要:#include<iostream> #include<queue> #include<cstdio> #include<cstring> using namespace std; double d[35]; int h[1010],cnt,n,pre[35]; bool vis[35]; stru
阅读全文
摘要:#include<iostream> #include<queue> #include<cstring> using namespace std; const int N=1e6+10,INF=0x3f3f3f3f; int h[N],ne[N],e[N],w[N],idx; int dist[N]
阅读全文
摘要:#include<iostream> #include<algorithm> using namespace std; const int N=1e5; struct edge{ int a,b,w; }e[N]; bool cmp(edge a,edge b) { return a.w<b.w;
阅读全文
摘要:#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=0x3f3f3f3f; int p[50]; struct edge{ int a,b,w; }e[100]; bool
阅读全文
摘要:#include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; const int N=1010; struct edge{ int start; int end; int
阅读全文
摘要:#include<cstdio> #include<cstring> #include<algorithm> #include<iostream> using namespace std; const int N=1010; int n; char a[N][N]; //da[i][j]是a[i][
阅读全文
摘要:#include<cstdio> #include<iostream> #include<cstring> using namespace std; int n,k; int dir[4][2]={{-1,0},{1,0},{0,-1},{0,1}}; int dp[101][101],mp[101
阅读全文
摘要://dp[i][j]表示第i次从左边取,第j次从右边取的价值,所以我们可以得到状态方程 //dp[i][j]=max(dp[i-1][j]+(i+j)*a[i],dp[i][j-1]+(i+j)*a[n-j+1]) (i > 0 && j > 0 ) //dp[i][0]=dp[i-1][0]+i*
阅读全文
摘要:#include<iostream> using namespace std ; const int N=1010; int f[N]; int a[N]; int n; int main() { cin>>n; for(int i=1; i<=n; i++) cin>>a[i]; for(int
阅读全文
摘要:#include<iostream> #include<stdio.h> #include<algorithm> #include<cstring> using namespace std; const int N=1010; const int M=20010; const int INF=0x3
阅读全文
摘要:#include <iostream> #include <algorithm> #include <string> #include <cstring> #include <cstdio> #define MAX 1005 using namespace std; int ans[MAX][MAX
阅读全文
摘要:#include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; struct node { int w, s; int index; //储存标号 } mouse[1005];
阅读全文
摘要:#include<iostream> using namespace std; const int N=1e5; int T,n; int a[N],b[N]; int dp[N]; int main() { cin>>T; while(T--) { cin>>n; for(int i=1;i<=n
阅读全文
摘要:/*题都是有一个状态转移方程式 , 只要推出方程式就问题不大了,首 先对于gameboy来说他下一秒只能 在0~10这十一个位置移动, 而对于1~9这九个位置来说他可以移动(假设他现在的位置为x)到x+1,或者x-1,或者x; 0和10这两个位置只有两个位置可以移动, 可以用dp[t][x],t秒的
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; const int INF=0x3f3f3f3f; int t,e,f,n,dp[10010]; struct node { int p, w; //价值 重量 } no[10000]
阅读全文
摘要:#include<iostream> #include<cstring> #include<cstdio> #include<string> #include<cmath> using namespace std; const int INF=0x3f3f3f3f; const int MAXN=(
阅读全文
摘要:/* dp[i][j]=max(dp[i][j-1]+a[j],max(dp[i-1][k])+a[j]) (0<k<j) dp[i][j-1]+a[j]表示的是前j-1分成i组,第j个必须放在前一组里面。 max( dp[i-1][k] ) + a[j] )表示的前(0<k<j)分成i-1组,第j
阅读全文
摘要:#include<iostream> #include<algorithm> #include<cstring> #include<vector> using namespace std; const int INF=0x3f3f3f3f; struct node{ int l,s,h; }; ve
阅读全文
摘要:#include<iostream> #include<cstring> #include<cmath> #include<cstdio> #include<algorithm> #include<stack> #include<queue> using namespace std; const i
阅读全文
摘要://判断负环 在负环内的城市输出? #include <iostream> #include <queue> #include <cstdio> #include <algorithm> #include <string.h> #include <string> using namespace st
阅读全文
摘要:#include<iostream> #include<algorithm> #include<queue> #include<cstdio> #include<cstring> using namespace std; const int N=1100,INF=0x3f3f3f3f; int h[
阅读全文
摘要:#include<cstdio> #include<cmath> #include<cstring> #include<cstring> #include<iostream> #include<queue> using namespace std; const int N=205; const do
阅读全文
摘要://从起点1到剩余P-1个点的最短距离之和+从剩余P-1个点到起点1的最短距离之和 #include<iostream> #include<cstring> #include<cstdio> #include<queue> using namespace std; const int LEN=100
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; const int N=110,INF=0x3f3f3f3f; int f[N][N]; int main() { int n,m; cin>>n>>m; memset(f,0x3f,
阅读全文
摘要:#include<cstdio> #include<cstdlib> #include<cstring> #include<iostream> using namespace std; const int N=110; const int INF = 0x3f3f3f3f; char s[20];
阅读全文
摘要://判断负环 dist初始化为正无穷 //正环 负无穷 #include<iostream> #include<cstring> #include<queue> #include<algorithm> using namespace std; const int N = 510, M = 5210;
阅读全文
摘要://spfa 判断正环 #include<iostream> #include<queue> #include<cstring> using namespace std; const int N=1e4; const int INF=2e9; int h[N],to[N],ne[N],idx; do
阅读全文