自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【题解】 CCF CSP 202104-2 —— 邻域均值

#include <iostream>#include <cmath>using namespace std;bool Judge(int **A, int n, int r, int t, int i, int j, double &exist_sum, int &exist_y0, int &exist_y1){ double sum = 0; int count = 0; double average; int x0, y0, x1.

2021-06-25 17:32:43 754

原创 【题解】CCF CSP 202104-1 —— 灰度直方图

#include <iostream>using namespace std;int main(){ int n, m, L; cin >> n >> m >> L; int **A = new int*[n]; for(int i = 0; i < n; i++) A[i] = new int[m]; for(int i = 0; i < n; i++) for(int j = 0; j < m; j+.

2021-06-25 17:21:17 365

原创 【题解】CCF CSP 202012-2 —— 期末预测之最佳阈值

**解题心得:题主在第一次做这题时,想尝试着用最简单的暴力算法去求解每个学生对应的 y 作为阈值时的正确率,但时间复杂度过大,无法应付最后30%的测试用例!故之后采用优化后的算法,先将输入的每个学生的 y 值与是否挂科结果 result 存于已定义好的结构体中,然后将其结构体数组按每个元素的 y 值大小进行从大到小排序,这样可以得到一个以 y 值降序排列的结构体数组(方便于之后求解每个 y 作为阈值的正确率)!**如何算每个 y 作为阈值的正确率 ?首先,用最原始的办法遍历算出排在结构体数组中第一.

2021-04-14 17:30:46 431

原创 【题解】CCF CSP 202012-1 —— 期末预测之安全指数

#include <iostream>using namespace std;int main(){ int n; cin >> n; int w, score; int y = 0; for(int i = 0; i < n; i++) { cin >> w >> score; y += w * score; } if(y >= 0) cout << y; else cout << 0;.

2021-04-13 22:35:29 120

原创 【题解】CCF CSP 202009-2 —— 风险人群筛查

#include <iostream>using namespace std;typedef struct { int x; int y;}position; //坐标 bool panduan(int xl, int yd, int xr, int yu, int px, int py) //判断函数 { if((px >= xl && px <= xr) && (py >= yd && py <.

2021-04-12 23:08:01 134

原创 【题解】CCF CSP 202009-1 —— 称检测点查询

#include <iostream>#include <algorithm>using namespace std;int calculate(int x, int y, int px, int py){ return (px-x)*(px-x) + (py-y)*(py-y);}int main(){ int n, X, Y; cin >> n >> X >> Y; int (*point)[2] = new i.

2021-04-12 22:59:46 106

原创 【题解】CCF CSP 202006-2 —— 稀疏向量

#include <iostream>using namespace std;typedef struct { int index; long long value;} V;int main(){ int n, a, b; cin >> n >> a >> b; V *vector_a = new V[a]; V *vector_b = new V[b]; for(int i = 0; i < a; i++) c.

2021-04-11 22:07:53 83

原创 【题解】CCF CSP 202006-1 —— 线性分类器

#include <iostream>using namespace std;typedef struct { int x; int y; char type;}point;typedef struct{ int a; int b; int c;}line;int Judge(line L, point P){ int temp = L.a + L.b * P.x + L.c * P.y; if(temp > 0) return 1; else.

2021-04-11 22:03:48 77

原创 【题解】CCF CSP 201912-2 —— 回收站选址

#include <iostream>using namespace std;typedef struct { int x; int y;} position;typedef struct { int grade_0; int grade_1; int grade_2; int grade_3; int grade_4;} grade;bool Judge(position p, int n, position *list){ int flag = 0;.

2021-04-11 21:56:48 99

原创 【题解】CCF CSP 201912-1 —— 报数

#include <iostream>using namespace std;bool Judge(int num){ if(num % 7 == 0) return true; else if(num/1000 == 7 || (num%1000)/100 == 7 || (num%100)/10 == 7 || num%10 == 7) return true; else return false;}int main(){ int n ; cin >.

2021-04-11 21:51:47 69

原创 【题解】CCF CSP 201909-2 —— 小明种苹果(续)

#include <iostream>#include <vector>using namespace std;int main(){ int n; cin >> n; vector<int> tree[n]; for(int i = 0; i < n; i++) { int temp; cin >> temp; tree[i].push_back(.

2021-04-11 21:20:21 65

原创 【题解】CCF CSP 201909-1 —— 小明种苹果

#include <iostream>#include <math.h>using namespace std;int main(){ int N, M; //苹果树棵树 cin >> N >> M; //疏果操作轮数 int **tree = new int* [N]; for(int i = 0; i < N; i++) { tree[i] = new.

2021-04-11 21:14:41 69

原创 【题解】CCF CSP 201812-2 —— 小明放学

#include <iostream>#include <cmath>using namespace std;int main(){ int r, y, g; int n; cin >> r >> y >> g; cin >> n; long long sum_time = 0; for(int i = 0; i < n; i++) { int k, t.

2021-04-10 23:52:34 137

原创 【题解】CCF CSP 201812-1 —— 小明上学

【题解】CCF CSP 201812-1 —— 小明上学#include <iostream>using namespace std;int main(){ int r, y, g; int n; cin >> r >> y >> g; cin >> n; int sum_time = 0; for(int i = 0; i < n; i++) { int k, t

2021-04-10 23:46:22 112

空空如也

空空如也

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

TA关注的人

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