- 博客(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
225
原创 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
212
原创 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
245
原创 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
131
原创 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
93
原创 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
97
原创 mysql数据库的列类型总结
mysql数据库的列类型总结 数值: tinyint 十分小的数据 1个字节 smallint 较小的数据 2个字节 mediumint 中等大小的数据 3个字节 int 标准的整数 4个字节 bigint 较大的数据 8个字节 float 浮点数 4个字节 double 浮点数 8个字节 decimal 字符串形式的浮点数 字符串: char 字符串固定大小的 0-255 varchar 可变字符串 0-65535 tinytext 微型文本 2^8-1 text 文本串 2^
2020-10-11 15:42:44
139
原创 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
158
原创 基本的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
184
原创 Markdown基本语法
Markdown基本语法 文件后缀名: .md 标题: 若干个(1<=n<=6)井号+标题名+回车 字体: 粗体:两边都加两个星号 斜体:两边都加一个星号 粗体and斜体:两边都加三个星号 删除线:两边都加两个波浪号 引用: 引用写法是大写箭头+空格+回车 分割线: 三个减号或三个星号+回车 图片: 感叹号+左中括号+图片名称+右中括号+左小括号+图片路径+右小括号 超链接: 百度 左中括号+链接名+右中括号+左小括号+链接地址+右小括号 列表: 有序: 数字+点+空格 无序 减号+空格
2020-09-30 17:06:37
382
原创 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
115
原创 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
133
原创 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
119
原创 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
150
原创 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
137
原创 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
124
原创 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
132
原创 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
146
原创 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
451
原创 CCF历年题目201803-3 URL映射
代码: #include<stdio.h> #include<string.h> #include<string> #include<vector> #define MAXN 105 using 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
134
原创 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
105
原创 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
182
原创 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
138
原创 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
141
原创 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
162
转载 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
229
原创 CCF历年题目201803-4 棋局评估
代码: #include <bits/stdc++.h> #define ll long long #define INF 0x3f3f3f3f using 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
171
原创 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
125
原创 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
223
原创 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
165
原创 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
157
原创 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
193
原创 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
192
原创 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
137
原创 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
95
原创 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
147
原创 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
113
原创 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
99
原创 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
121
原创 PAT甲级1121 Damn Single
代码: #include <iostream> #include <string> #include <algorithm> #include <vector> #include <map> #include <set> #include <cstring> #define MAX 100000 using namespace std; int n, m; int list[MAX]; bool isCome[MAX]; m
2020-08-22 10:41:09
106
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人