自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(140)
  • 收藏
  • 关注

转载 多项式A除以B

原题链接#include <cstdio>#include <cmath>using namespace std;int nonNegativeNum(double c[], int start) { int cnt = 0; for (int i = start; i >= 0; i--) if (abs(c[i]) + 0.05 >= 0.1) cnt++; return cnt;}void printPoly(do

2021-05-21 10:49:41 477

原创 L2-007 家庭房产 (25 分)

原题链接#include <stdio.h>#include <iostream>#include <map>#include <set>#include <algorithm>using namespace std;int N, M, K;const int si = 10007;int par[si];int cnt[si];double area[si];int housenum[si];bool vis[si];

2021-05-21 10:44:35 123

原创 L2-006 树的遍历 (25 分)

原题链接#include<bits/stdc++.h>using namespace std;typedef struct node* bintree;int post[40],in[40]; int n;vector<node> tree;int p=-1;struct node{ int data; int l,r;};int create(int postl,int postr,int inl,int inr){ int i

2021-05-20 22:01:24 132

原创 L2-005 集合相似度 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;set<int> st[100];set<int> sc, se;int main(){ int n, k, x; cin >> n; for (int i = 1; i <= n; i++) { cin >> k; for (int j = 0; j < k; j+

2021-05-20 22:00:39 97

原创 L2-004 这是二叉搜索树吗? (25 分)

原题链接#include <bits/stdc++.h>using namespace std;int ismirror;vector<int> pre, post;void getpost(int root, int tail){ if (root > tail) return; int i = root + 1, j = tail; if (!ismirror) { while (i <= t

2021-05-20 21:59:14 94

原创 L2-003 月饼 (25 分)

原题链接#include<bits/stdc++.h>using namespace std;struct node{ double liang; double danjia; double zong;}p[1111];bool cmp(node a,node b){ return tie(a.danjia)>tie(b.danjia);}int main(){ int n,x; cin>>n>>x;

2021-05-20 21:58:34 82

原创 L2-002 链表去重 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;const int N = 1e9;int vis[111111];struct node{ int adress; int key; int next; int num;} p[111111];bool cmp(node a, node b){ return a.num < b.num;}int main(){ int h

2021-05-20 21:57:52 65

原创 L2-001 紧急救援 (25 分)

原题链接#include<bits/stdc++.h>using namespace std;int cnt[1111]; //最短路径条数int book[1111]; //各个城市是否经过int jiu[1111]; //每个城市救援队数量int jiuyuan[1111]; //到达该城市召集的所有救援队的数量int pre[1111]; //到达该城市前所经历的编号int n, m,s,d,u;int inf = 9999999;int

2021-05-20 21:57:09 110

原创 L2-008 最长对称子串 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;int main(){ string s; getline(cin, s); int ans = 1; for (int i = 0; i < s.length(); i++) { for (int j = s.length() - 1; j >= i; j--) { int l = i

2021-05-19 21:35:40 83

原创 L2-009 抢红包 (25 分)

原题链接#include<bits/stdc++.h>using namespace std;struct node{ double shou,fa; int geshu; double shouru; int num;}p[11111];bool cmp(node a,node b){ return tie(a.shouru,a.geshu,b.num)>tie(b.shouru,b.geshu,a.num);}int b,t;/

2021-05-19 21:34:49 78

原创 L2-010 排座位 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;int f[1111];int c[111][111];void init(){ for (int i = 0; i < 111; i++) { f[i] = i; }}int find(int x){ return f[x] == x ? x : f[x] = find(f[x]);}void merge(int x, in

2021-05-19 21:34:00 85

原创 L2-011 玩转二叉树 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;vector<int> level(10000, -1);vector<int> in, pre;void leveorder(int root, int start, int end, int index){ if (start > end) return; int i = start; while (i < e

2021-05-19 21:33:11 53

原创 L2-012 关于堆的判断 (25 分)

原题链接#include<bits/stdc++.h>using namespace std;int a[111111],cnt;int inf=999999999;map<int,int>p;void creat(int x){ a[++cnt]=x; int t=cnt; while (t>1&&(a[t/2]>a[t])) { a[t]=a[t/2]; a[t/2]=x;

2021-05-19 21:32:22 133

原创 L2-013 红色警报 (25 分)

原题链接#include<bits/stdc++.h>using namespace std;int f[600];int lost[600];int n,m,a,b;vector<int >w;struct node{ int x,y;}road[5100];int get(int x){ return f[x]==x?f[x]:f[x]=get(f[x]);}void merge(int x,int y){ int nx=g

2021-05-19 21:31:23 110

原创 L2-014 列车调度 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;set<int> s;int main(){ int n,x; cin >> n; for (int i = 0; i < n; i++) { cin >> x; auto e=s.lower_bound(x); if(e!=s.end()) {

2021-05-19 21:30:10 78

原创 L2-015 互评成绩 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;vector<int> v[11111];int x;vector<double> st;int main(){ int n, m, k; cin >> n >> k >> m; for (int i = 0; i < n; i++) { for (int j = 0; j

2021-05-19 21:29:31 67

原创 L2-016 愿天下有情人都是失散多年的兄妹 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;vector<int> v[111111];int vis[111111];int f;void dfs(int x, int y){ if (y >= 4) return; vis[x] = 1; for (int i = 0; i < v[x].size(); i++) { if (vis[v[x

2021-05-19 21:28:39 4731

原创 L2-017 人以群分 (25 分)

原题链接#include<bits/stdc++.h>using namespace std;int q[200000];int sum,sum1,sum3,sum2;int main(){int n;cin>>n;for(int i=0;i<n;i++){ cin>>q[i];}sort(q,q+n);if(n%2==0){ for(int i=0;i<n/2;i++) sum+=q[i]; fo

2021-05-19 21:27:28 74

原创 L2-019 悄悄关注 (25 分)

原题链接#include<bits/stdc++.h>using namespace std;struct node{ string s; int q;}p[11111];double sum;int flag=0;map<string,int>w;bool cmp(node a,node b){ return tie(a.s)<tie(b.s);}int main(){ int n; cin>>n;

2021-05-18 21:45:27 50

原创 L2-020 功夫传人 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;int n, k, x;double z, r, ans;double p[111111];int vis[111111];vector<int> w[111111];void bfs(int x){ queue<int> vv; vv.push(x); while (!vv.empty()) { int tem

2021-05-18 21:44:29 51

原创 L2-021 点赞狂魔 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;struct node{ string name; set<int>st; int t; //int tt;}p[200];bool cmp(node a,node b){ if(a.st.size()!=b.st.size()) return a.st.size()>b.st.size(); else

2021-05-18 21:43:38 80

原创 L2-022 重排链表 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;struct node{ // int address; int data; int next;} p[111111];int main(){ int s, n, a; cin >> s >> n; for (int i = 0; i < n; i++) { cin >> a

2021-05-18 21:42:55 56

原创 L2-023 图着色问题 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;vector<int> w[11111];int coler[111111];set<int> st;int main(){ int n, m, k; cin >> n >> m >> k; for (int i = 0; i < m; i++) { int a, b;

2021-05-18 21:42:12 104

原创 L2-024 部落 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;int f[11111];set<int> st;set<int> sc;int find(int x){ if (f[x] == x) { return f[x]; } else return f[x] = find(f[x]);}void merge(int x, int y){ i

2021-05-18 21:41:30 52

原创 L2-025 分而治之 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;vector<int> q[11111];int vis[11111];int a, b;int n, m;int book[11111];int judge(){ for (int i = 1; i <= n; i++) { if (book[i]) { continue; }

2021-05-18 21:40:52 55

原创 L2-026 小字辈 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;vector<int> v[111111], ans;int deep = -1;void dfs(int x, int nowdeep){ if (nowdeep > deep) { deep = nowdeep; ans.clear(); } if (nowdeep == deep) {

2021-05-18 21:40:06 48

原创 L2-027 名人堂与代金券 (25 分)

原题链接#include<bits/stdc++.h>using namespace std;struct node{ int grade; string name; int dex;}p[11111];int k=1;int num=1;bool cmp(node a,node b){ if(a.grade!=b.grade) { return a.grade>b.grade; } else

2021-05-18 21:39:04 52

转载 L2-028 秀恩爱分得快 (25 分)

原题链接#include<bits/stdc++.h>#define Maxsize 1000using namespace std;int sex[Maxsize];///记录性别double rel[Maxsize][Maxsize];///记录亲密度double Max[Maxsize];///记录两人之间的最大值set<int>ss[Maxsize];///记录有最大值的人set<int>s[Maxsize];///记录照片信息///记录性别并把

2021-05-17 21:56:04 99

原创 L2-029 特立独行的幸福 (25 分)

原题链接#include <iostream>#include <vector>#include <cmath>using namespace std;vector<int> v;vector<int> dp;// 判断素数bool f(int x){ if (x == 1) return 0; for (int i = 2; i <= sqrt(x); i++) {

2021-05-17 21:55:00 75

原创 L2-030 冰岛人 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;bool judge(vector<int> &F, int s1, int s2){ int n = F.size(); vector<int> count(n, 0); vector<int> dist1(n, 0); vector<int> dist2(n, 0); int t ; c

2021-05-17 21:53:59 112

原创 L2-031 深入虎穴 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;vector<int> st[111111];int ans;int deep = -1;int f[111111];void init(){ for (int i = 0; i < 11111; i++) { f[i] = i; }}int find(int x){ return x == f[x] ? x :

2021-05-17 21:52:45 86

原创 L2-032 彩虹瓶 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;int main(){ int n, m, k, x; cin >> n >> m >> k; while (k--) { stack<int> st; int start = 1, f = 0; for (int i = 0; i < n; i++)

2021-05-17 21:51:20 70

原创 L2-033 简单计算器 (25 分)

[原题链接](https://pintia.cn/problem-sets/994805046380707840/problems/1336215880692482056)#include <bits/stdc++.h>using namespace std;stack<int> st;stack<char> vt;int main(){ int n, x; char c; cin >> n; for (int i = 0;

2021-05-17 21:50:21 364

原创 L2-034 口罩发放 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;map<string, int> shentibushi;map<string,int>day;map<string,int>shenqing;struct node{ string num; string name; int qingkuang; int hh; int mm; int pr; //输入

2021-05-17 21:48:07 342

原创 L2-035 完全二叉树的层序遍历 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;int post[11111], tree[11111];int n, x, cnt = 0;void dfs(int u){ if (u > n) return; dfs(u * 2); dfs(u * 2 + 1); tree[u] = post[++cnt];}int main(){ cin >> n;

2021-05-17 21:47:12 197

原创 L2-036 网红点打卡攻略 (25 分)

原题链接#include <bits/stdc++.h>using namespace std;int vt[1111][1300];int st[1100][1100];int vv[1100];int minn = 1111111111, a, b, c, k, sum, f;set<int> vc;int main(){ int n, m; cin >> n >> m; for (int i = 0; i &lt

2021-05-17 21:46:14 79

原创 天梯L2题解

L2-001 紧急救援L2-002 链表去重L2-003 月饼 L2-004 这是二叉搜索树吗?L2-005 集合相似度L2-006 树的遍历 L2-007 家庭房产 L2-008 最长对称子串L2-009 抢红包 L2-010 排座位 L2-011 玩转二叉树 L2-012 关于堆的判断 L2-013 红色警报 L2-014 列车调度 L2-015 互评成绩L2-016 愿天下有情人都是失散多年的兄妹 L2-017 人以群分 L2-018 多项式A除以BL2-019 悄

2021-05-17 21:43:20 206

原创 L1-059 敲笨钟 (20 分)

原题链接#include <bits/stdc++.h>using namespace std;int main(){ int n; cin >> n; string s; getchar(); int flag = 0; while (n--) { flag = 0; getline(cin, s); for (int i = 0; i < s.length();

2021-05-13 11:15:45 80

原创 L1-054 福到了 (15 分)

原题链接#include<bits/stdc++.h>using namespace std;int main(){ char c,e; int n,flag=1; string s[111]; cin>>c>>n; getchar(); for(int i=0;i<n;i++) { getline(cin,s[i]); } for(int i=0;i<n;i++) {

2021-05-13 11:15:33 39

原创 L1-050 倒数第N个字符串 (15 分)

原题链接#include<bits/stdc++.h>using namespace std;int f(int x){ int sum=1; for(int i=0;i<x;i++) { sum*=26; } return sum;}int main(){ char a[100];int n,m;cin>>n>>m;int t=f(n)-m;int j=0;for(int i=n-1;i>=0;i-

2021-05-13 11:15:18 55

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除