![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Code
Fealy_yang
这个作者很懒,什么都没留下…
展开
-
背包问题
1.01背包变形http://codeup.cn/problem.php?cid=100000631&pid=0二维会超限,需要变成滚动数组,01背包的滚动数组逆序,完全背包正序。dp[i]表示考虑到前i个所能达到的不超过v的最大重量,最后输出,用v减即可#include<bits/stdc++.h>using namespace std;#define MaxSi...原创 2019-08-18 17:58:11 · 90 阅读 · 0 评论 -
201403-4 无线网络 100
http://118.190.20.162/view.page?gpid=T7递归bfs超时版 0分#include<bits/stdc++.h>using namespace std;typedef long long ll;struct node{ ll x; ll y; bool add; bool chose; bool ope...原创 2019-08-13 11:02:24 · 101 阅读 · 0 评论 -
201803-3 URL映射 100
60#include<bits/stdc++.h>using namespace std;int n,m;char p[110][110];char quest[110];int Correct(char * a, char * pp){ char p[110]; int ppos=0; for( ppos=0;pp[ppos]!='\0';ppos++){ p[...原创 2019-08-16 16:44:54 · 85 阅读 · 0 评论 -
201403-3 命令行选项 90
http://118.190.20.162/view.page?gpid=T8#include<map>#include<iostream>#include<string>#include<string.h>using namespace std;map <char,bool> arg;map <char,string...原创 2019-08-12 18:38:19 · 310 阅读 · 0 评论 -
201809-1 卖菜 100 201809-2 买菜 100
http://118.190.20.162/view.page?gpid=T79 5‘#include<bits/stdc++.h>using namespace std;int a[1010];int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } int pre=...原创 2019-08-15 14:35:49 · 79 阅读 · 0 评论 -
201409-4 最优配餐 100
http://118.190.20.162/view.page?gpid=T13运行超时 10分//#include<bits/stdc++.h>#include<iostream>#include<queue>#include<map>using namespace std;int n,m,k,d;//0表示通路//-1表示障碍...原创 2019-08-14 17:48:04 · 129 阅读 · 0 评论 -
图的遍历 PAT 甲级
https://pintia.cn/problem-sets/994805342720868352/problems/994805500414115840输出cout会超时#include<bits/stdc++.h>using namespace std;int n,m,k,de;vector <int> G[1010];bool visit[1010]...原创 2019-08-19 10:45:40 · 118 阅读 · 0 评论 -
201409-3 字符串匹配 100
http://118.190.20.162/view.page?gpid=T14#include<bits/stdc++.h>#include<string>using namespace std;string standard,input,temp,temp2;void func(string standard,string input,int op){ if...原创 2019-08-14 09:41:53 · 103 阅读 · 0 评论 -
201409-2 画图 100
http://118.190.20.162/view.page?gpid=T15#include<bits/stdc++.h>using namespace std;struct rect{ int x1,y1,x2,y2;}rec[101];bool Is(rect a,int i,int j){ if(i >= a.x1 && i<a.x...原创 2019-08-14 08:31:47 · 99 阅读 · 0 评论 -
201409-1 相邻数对 100
http://118.190.20.162/view.page?gpid=T16#include<bits/stdc++.h>using namespace std;int a[10010]; int main(){ int n; int temp; cin>>n; for(int i=0;i<10010;i++) a[i]=0; for(in...原创 2019-08-14 08:15:16 · 125 阅读 · 0 评论 -
动态规划 算法笔记
1.数塔问题#include<bits/stdc++.h>using namespace std;int a[50][50]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ cin>>a[i][j]; } } int...原创 2019-08-17 10:18:21 · 184 阅读 · 0 评论