自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 ALDS1_11_C

#include<iostream>#include<vector>#include<queue>#include<cstring>using namespace std;#define MAX 100002#define NIL -1int color[MAX] = {0};int n, m;vector<int> G[MAX];int bfs(int r,int c) { queue<int> Q;

2020-07-25 20:59:40 80

原创 ALDS1_8_C

#include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>using namespace std;struct Node { int key; Node *parent, *left, *right;};Node *NIL, *root = NIL;void insert(int k) { Node *z,*y = NIL,*r = root;

2020-07-22 20:08:10 90

原创 ALDS1_8_B

#include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>using namespace std;struct Node { int key; Node *parent, *left, *right;};Node *NIL, *root = NIL;void insert(int k) { Node *z,*y = NIL,*r = root;

2020-07-21 15:34:55 93

原创 ALDS1_8_A

#include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>using namespace std;struct Node { int key; Node *parent, *left, *right;};Node *NIL, *root = NIL;void insert(int k) { Node *z,*y = NIL,*r = root;

2020-07-20 15:43:49 117

原创 ALLOCATION

#include<stdio.h>#include<stdlib.h>int n,k;int w[10001];int check( long long p){ int j = 0; int i = 0; long long s = 0; while ( j < k ){ s = 0; // s += w[i]; while(1){ s += w[i];

2020-07-19 22:11:58 182

原创 ALDS_10_B

#include<iostream>using namespace std;int n;int m[101][101];int p[101];int main() { cin >> n; int count = n - 1, temp, i, j, k; cin >> p[0] >> p[1]; for ( i = 2; i <= n; i++ ) { cin >> temp &

2020-07-18 20:02:32 82

原创 ALDS1_11_D

#include<iostream>#include<queue>using namespace std;int A[101][101] = {0};int n, tt = 0, d[101] = {0}, color[101] = {0};queue<int> Q;void bfs (int u) { int i, j ,k; Q.push(u); d[u] = tt++; color[u] = 1; while

2020-07-13 22:02:53 112

原创 ALDS1_11_C

·#include<iostream>#include<queue>using namespace std;int A[101][101] = {0};int n, tt = 0, d[101] = {0}, color[101] = {0};queue<int> Q;void bfs (int u) { int i, j ,k; Q.push(u); d[u] = tt++; color[u] = 1; whil

2020-07-11 19:44:23 128

原创 Exhaustive Search

#include<stdio.h>int flag = 0;int n,A[20];void solve(int i, int m) { if( m == 0) { flag = 1; return; } if ( m < 0 || i == n ) return ; solve(i+1, m); solve(i+1, m - A[i]);}int main(){ int q

2020-07-10 20:16:28 162

原创 ALDS1_6_A

//必须要从后往前排,这样才具有稳定性。#include<stdio.h>#include<stdlib.h>#define MAX 2000001#define VMAX 10000int C[VMAX+ 1];int n;void CountingSort(unsigned short A[],unsigned short B[], int k) { for ( int i = 0; i <= k; i++) { C[i] = 0;.

2020-07-07 15:49:03 122

原创 ALDS1_5_B

#include<stdio.h>#include<iostream>using namespace std;#define MAX 500000#define SENTINEL 2000000000int Left[MAX/2+2];int Right[MAX/2+2];int cnt;void merge(int A[], int left, int right, int mid){ int n1 = mid - left; int n2

2020-07-06 18:41:31 97

原创 sort

希尔排序基于插入排序。直接插入排序针对小众数据或有序数据时高效;希尔排序在逻辑上将数据划分为小众数据或较为有序的数据,以此提高效率#include#include#includeusing namespace std;//g数组vectorG;long long cnt;int A[1000000 + 10];// 间隔为g的插入排序void insertionSort(int A[], int n, int g) {for (int i = g; i < n; i++) {i

2020-07-06 14:46:08 67

原创 规划

计划在近期完成课程设计答辩以及作业后开始进行算法练习 ,练习的内容集中于白皮书和蓝桥杯真题

2020-07-01 11:16:32 97

空空如也

空空如也

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

TA关注的人

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