- 博客(176)
- 收藏
- 关注
原创 1012 The Best Rank
#include<bits/stdc++.h>using namespace std;struct Grade{ char pro; int score; int rank;};struct Stu{ int id; Grade grade[4];};vector<Stu> v;map<char,int> ma;map<int,int> m2;int cmp1(Stu stu1,Stu stu2){ return stu1.gr
2020-12-13 10:49:03
208
原创 1084 Broken Keyboard
#include<bits/stdc++.h>using namespace std;int main(){ string s1,s2; map<char,int> m1; map<char,int> m2; cin>>s1; cin>>s2; for(char c:s2) { if(c>='a'&&c<='z') c-=32; m1[c]=1; } for(char c:s1) {
2020-12-13 09:52:06
199
原创 1146 Topological Order
#include<bits/stdc++.h>using namespace std;int in[1005]; int temp[1005];int main(){vector v[1005];vector re;int n,m;scanf("%d %d",&n,&m);int a,b;for(int i=0;i<m;i++){ scanf("%d %d",&a,&b); v[a].push_back(b); in[b]+..
2020-12-11 22:40:07
231
原创 1116 Come on! Let‘s C
#include<bits/stdc++.h> using namespace std;bool isprime[10005];int champion,number;map<int,int> m;void getPrime(){ for(int i=1;i<=10004;i++) { isprime[i]=true; } for(int i=2;i<=10004;i++) { if(isprime[i]) { for(int j=
2020-12-11 22:01:15
118
原创 1125 Chain the Ropes
#include<bits/stdc++.h>using namespace std;int main(){ int N; scanf("%d",&N); int A[N]; for(int i=0;i<N;++i) scanf("%d",&A[i]); sort(A,A+N); double sum=A[0]; for(int i=1;i<N;++i) sum=(sum+A
2020-12-11 21:07:38
85
原创 1144 The Missing Number
#include<stdio.h>#include<map>using namespace std;int main(){ int i,n,t; map<int,bool> m; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&t); if(t>0) m[t]=1; } for(i=1;;i++
2020-12-11 20:58:07
90
原创 mysql数据库的列类型总结
mysql数据库的列类型总结数值:tinyint 十分小的数据 1个字节smallint 较小的数据 2个字节mediumint 中等大小的数据 3个字节int 标准的整数 4个字节bigint 较大的数据 8个字节float 浮点数 4个字节double 浮点数 8个字节decimal 字符串形式的浮点数字符串:char 字符串固定大小的 0-255varchar 可变字符串 0-65535tinytext 微型文本 2^8-1text 文本串 2^
2020-10-11 15:42:44
127
原创 Maven环境搭建
Maven环境搭建在官网下载maven压缩包官网:点击进入maven官网配置系统环境变量变量名:MAVEN_HOME 内容:maven安装目录PATH变量添加内容:maven安装目录下的bin目录修改镜像打开conf目录下的setting.xml文件找到mirrors标签添加如下内容 <mirror> <id>alimaven</id> <mirrorOf>central</
2020-10-01 18:46:34
149
原创 基本的Dos命令
基本的Dos命令打开cmd的方式开始+系统+命令提示符Win键+R 输入cmd在任意的文件夹下面,按住shift+鼠标右键点击,在此处打开命令行窗口资源管理器的地址栏前面加上cmd常用的Dos命令切换盘符:盘符名称+冒号+回车查看当前目录下所有文件:dir打开当前目录下文件:cd+空格+文件名称打开其他磁盘下文件:cd+空格+/d+磁盘名称+:++文件名返回上一级目录:cd …清理屏幕:cls退出终端 :exit查看ip配置:ipconfig打开计算器:calc打开画图
2020-09-30 17:53:49
171
原创 Markdown基本语法
Markdown基本语法文件后缀名:.md标题:若干个(1<=n<=6)井号+标题名+回车字体:粗体:两边都加两个星号斜体:两边都加一个星号粗体and斜体:两边都加三个星号删除线:两边都加两个波浪号引用:引用写法是大写箭头+空格+回车分割线:三个减号或三个星号+回车图片:感叹号+左中括号+图片名称+右中括号+左小括号+图片路径+右小括号超链接:百度左中括号+链接名+右中括号+左小括号+链接地址+右小括号列表:有序:数字+点+空格无序减号+空格
2020-09-30 17:06:37
368
原创 PAT甲级题目1086 Tree Traversals Again
代码:#include <cstdio>#include <vector>#include <stack>#include <cstring>using namespace std;vector<int> pre, in, post,value;void postorder(int root, int start, int end) { if (start > end) return; int i = start
2020-09-11 10:41:31
104
原创 PAT甲级题目1080 Graduate Admission
代码:#include <iostream>#include <vector>#include <algorithm>using namespace std;struct peo{ int id, ge, gi, fin; vector<int> choice;};bool cmp(peo& a, peo& b) { if (a.fin != b.fin) return a.fin > b.fin;
2020-09-11 10:14:55
118
原创 PAT甲级题目1045 Favorite Color Stripe
代码:#include <iostream>#include <vector>using namespace std;int book[201], a[10001], dp[10001];int main() { int n, m, x, l, num = 0, maxn = 0; scanf("%d %d", &n, &m); for(int i = 1; i <= m; i++) { scanf("%d",
2020-09-11 09:32:44
112
原创 PAT甲级题目1072 Gas Station
代码:#include <iostream>#include <algorithm>#include <string>using namespace std;const int inf = 999999999;int n, m, k, ds, station;int e[1020][1020], dis[1020];bool visit[1020];int main() { fill(e[0], e[0] + 1020 * 1020, inf);
2020-09-11 09:11:42
138
原创 PAT甲级题目1111 Online Map
代码:#include <iostream>#include <algorithm>#include <vector>using namespace std;const int inf = 999999999;int dis[510], Time[510], e[510][510], w[510][510], dispre[510],Timepre[510], weight[510],NodeNum[510];bool visit[510];vector&
2020-09-10 20:43:50
126
原创 PAT甲级题目1126 Eulerian Path
代码:#include <iostream>#include <vector>using namespace std;vector<vector<int> > v;vector<bool> visit;int cnt = 0;void dfs(int index) { visit[index] = true; cnt++; for (int i = 0; i < v[index].size(); i++)
2020-09-10 20:35:28
112
原创 PAT甲级题目1087 All Roads Lead to Rome
代码:#include<cstdio>#include<string>#include<cstring>#include<iostream>#include<algorithm>#include<map>using namespace std;const int maxn=1000;const int INF=100000000;int st,n,m,G[maxn][maxn];int d[maxn],cost[m
2020-09-10 20:13:41
121
原创 CCF历年题目201903-4 消息传递接口
代码:#include<bits/stdc++.h>using namespace std;int main(){ int T,n; scanf("%d%d%*c",&T,&n); while(T--){ list<pair<queue<int>,int>>process;//first成员是一个队列,存储每个进程的所有指令;second成员存储上一条执行的指令,初始化为INT_MAX
2020-09-09 22:43:36
131
原创 CCF历年题目201612-3 权限查询
代码:#include<cstdio>#include<cstring>#include<cstdlib>#include<iostream>#include<vector>#include<string>#include<map>using namespace std;map<string, map<string, int> > map_role_pri; //角色权限表map
2020-09-07 21:22:23
437
原创 CCF历年题目201803-3 URL映射
代码:#include<stdio.h>#include<string.h>#include<string>#include<vector>#define MAXN 105using namespace std;char rule[MAXN][MAXN];char name[MAXN][MAXN];int n,m;vector<string> value;//参数值 bool deal_str(char *str, char*
2020-09-07 20:58:31
122
原创 CCF历年201703-3 Markdown
代码:#include <string>#include <iostream>using namespace std;void solve_last_segment(bool &ul, bool ¶graph)//解决上一区块的遗留问题{ if(ul){ cout << "</ul>" << endl; ul = false; } if(paragraph)
2020-09-06 22:18:48
100
原创 CCF历年201512-3 画图
代码:#include<bits/stdc++.h>using namespace std;char s[105][105];int m,n,q;void TianChong(int x,int y,char ch){ //cout<<m<<" "<<n<<endl; if(x>=0&&x<m&&y>=0&&y<n){ //cout&l
2020-09-06 19:56:02
171
原创 CCF历年题目201604-4 游戏
代码:#include<bits/stdc++.h>using namespace std;struct Vertex{ int r,c,t; Vertex(int rr,int cc,int tt):r(rr),c(cc),t(tt) {}};bool inQueue[105][105][305];//标志一个结点是否已入队int n,m,t,direction[4][2]={{-1,0},{0,1},{1,0},{0,-1}};//方向int main(){
2020-09-06 18:05:15
129
原创 CCF历年题目201409-3 字符串匹配
代码:#include<iostream>#include<string>using namespace std;string s1, s2;void exchange(string &s) //全部转为小写字母{ int k = s.size(); for (int i = 0; i < k; i++) { if (s[i] >= 'A' && s[i] <= 'Z')
2020-09-06 17:48:37
128
原创 CCF历年题目201709-4 通信网络
代码:#include<cstdio>#include<vector>#include<queue>#include<cstring>using namespace std;int n,m;const int MAXN = 1005;vector<int> v[MAXN];bool visit[MAXN];int G[MAXN][MAXN];int number; int ans;queue<int> q;v
2020-09-05 21:17:04
152
转载 CCF历年题目201909-4 推荐系统
代码:#include <bits/stdc++.h>using namespace std;struct Commodity { //商品类 long long id, score; //id和分数 Commodity(long long i, long long s) : id(i), score(s) {} bool operator<(const Commodity& c) const { //重载小于运算符 return
2020-09-05 20:48:37
216
原创 CCF历年题目201803-4 棋局评估
代码:#include <bits/stdc++.h>#define ll long long#define INF 0x3f3f3f3fusing namespace std;int g[4][4]; bool read(){ memset(g, 0, sizeof(g)); bool flag = false; for(int i = 1; i <= 3; ++i) for(int j = 1; j <= 3; ++j)
2020-09-05 14:58:09
159
原创 CCF历年题目201812-4 数据中心
代码:#include<queue>#include<cstdio>using namespace std;const int MAXN = 500005;int n,m,root;struct Edge{ int start,end,cost; Edge(int s,int e,int c):start(s),end(e),cost(c){}; bool operator < (const Edge& e) const { return cos
2020-09-05 14:46:12
118
原创 CCF历年题目201703-4 地铁修建
代码:#include<queue>#include<cstdio>using namespace std;const int MAXN = 100005;int n,m;struct Edge{ int start,end,cost; Edge(int s,int e,int c):start(s),end(e),cost(c){}; bool operator < (const Edge& e) const { return cost>
2020-09-05 14:19:25
209
原创 CCF历年题目201509-4 高速公路
10分代码:#include<cstdio>#include<vector>using namespace std;int n,m;const int MAXN = 1005;vector<int> v[MAXN];bool visit[MAXN];int G[MAXN][MAXN];int start;int number=0;void dfs(int s){ G[start][s]=1; for(int i=0;i<v[s].size
2020-09-05 13:48:31
152
原创 CCF历年题目201503-4 网络延时
代码:#include<vector>#include<cstdio>using namespace std;const int MAXN = 20005;int n,m;vector<int> v[MAXN];bool visit[MAXN];int last;int maxlevel;void dfs(int x,int level){ if(level>maxlevel) { maxlevel=level; last=x;
2020-09-05 13:02:28
142
原创 CCF历年题目201412-4 最优灌溉
代码:#include<queue>#include<cstdio>using namespace std;const int MAXN = 1005;int n,m;struct Edge{ int start,end,cost; Edge(int s,int e,int c):start(s),end(e),cost(c){}; bool operator < (const Edge& e) const { return cost>e.
2020-09-05 11:59:54
183
原创 CCF历年题目201409-4 最优配餐
代码:#include<queue>#include<cstdio>using namespace std;const int MAXN = 1005;int n,m,k,d;int G[MAXN][MAXN];struct position{ int x,y,cost; position(int xx,int yy,int c=0):x(xx),y(yy),cost(c){};};int dir[4][2]={0,-1,0,1,-1,0,1,0};bool
2020-09-05 10:28:49
180
原创 CCF历年题目201403-4 无线网络
代码:#include<cstdio>#include<queue>#include<vector>#include<cmath>using namespace std;const int MAXN=205;int n,m,k;long long r;bool visit[MAXN];struct node{ long long x,y; int step,sum; };vector<node> v;int num=
2020-09-05 08:39:27
126
原创 PAT甲级题目1022 Digital Library
代码:#include<bits/stdc++.h>using namespace std;void query(map<string,set<int> > &m, string &s){//查询操作 if(m.find(s)==m.end())//如果在m中查找不到s printf("Not Found\n"); else for(auto it=m[s].begin();it!=m[s].end()
2020-08-22 13:28:22
89
原创 PAT甲级题目1078 Hashing
代码:#include <iostream>#include <string.h>using namespace std;bool isPrime(int x){ if (x == 1) return false; if (x == 2 || x == 3) return true; for (int i = 2; i*i <= x; i++) { if (x%i == 0) return false; } return true;}b
2020-08-22 13:11:30
138
原创 PAT甲级题目1077 Kuchiguse
代码:#include <cstdio>#include <algorithm>#include <vector>#include <iostream>#define min(a,b) (a) > (b)?(b):(a)using namespace std;int n, len = 9999999;string s[105];vector<char> v;int main() { scanf("%d", &n
2020-08-22 12:45:47
108
原创 PAT甲级题目1071 Speech Patterns
代码:#include<cstdio>#include<map>#include<iostream>#include<cctype>#include<string>using namespace std;int main(){ string s,t; getline(cin,s); map<string,int> cnt; for (int i=0;i<s.length();i++) { if (isa
2020-08-22 11:29:26
90
原创 PAT甲级1093 Count PAT‘s
代码:#include <iostream>#include <vector>#include <cstring>#include <cstdio>using namespace std;int main(){ string str; cin >> str; int len = str.length(); int res = 0; vector<int> p(len); ve
2020-08-22 10:58:35
110
原创 PAT甲级1121 Damn Single
代码:#include <iostream>#include <string>#include <algorithm>#include <vector>#include <map>#include <set>#include <cstring>#define MAX 100000using namespace std;int n, m;int list[MAX];bool isCome[MAX];m
2020-08-22 10:41:09
93
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人