City Horizon

2023-11-04


http://acm.hust.edu.cn:8080/judge/contest/viewProblem.action?pid=45728
Description

Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildings.

The entire horizon is represented by a number line with N (1 ≤ N ≤ 40,000) buildings. Building i's silhouette has a base that spans locations Ai through Bi along the horizon (1 ≤ Ai < Bi ≤ 1,000,000,000) and has height Hi (1 ≤ Hi ≤ 1,000,000,000). Determine the area, in square units, of the aggregate silhouette formed by all N buildings.

Input

Line 1: A single integer:  N 
Lines 2.. N+1: Input line  i+1 describes building  i with three space-separated integers:  AiBi, and  Hi

Output

Line 1: The total area, in square units, of the silhouettes formed by all  N buildings

Sample Input

4
2 5 1
9 10 4
6 8 2
4 6 3

Sample Output

16

Hint

The first building overlaps with the fourth building for an area of 1 square unit, so the total area is just 3*1 + 1*4 + 2*2 + 2*3 - 1 = 16.
¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥
第一份代码:
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
struct node1{
	int x,y;
	__int64 h;
	bool operator<(const node1 &T)const
	{
			return h<T.h;
	}
}M[400005];
struct node2{
	int s,n,flag;
	bool operator<(const node2 &T)const
	{
		if(s!=T.s)
			return s<T.s;
		else return n<T.n;
	}
}F[400005*2+10];
struct node3{
	int l,r;
	__int64 h;
	int mid()
	{
		return (l+r)>>1;
	}
}T[400005*5];
int H[400005*2+10];
__int64 ss=0;
void build(int l,int r,int root)
{
	T[root].l=l;T[root].r=r;
	T[root].h=0;
	if(r>l+1)
	{
		int mid=T[root].mid();
		build(l,mid,root<<1);
		build(mid,r,root<<1|1);	
	}
}
void modify(int l,int r,int h,int root)
{
	
	if(T[root].l==l&&T[root].r==r)
	{
		T[root].h=h;
		return ;
	}
	if(T[root].h!=0)
	{           
		T[root<<1].h=T[root].h;
		T[root<<1|1].h=T[root].h;
		T[root].h=0;
	}
	int mid=T[root].mid();
	if(r<=mid)
		 modify(l,r,h,root<<1);
 	else if(l>=mid)
 		modify(l,r,h,root<<1|1);
	else {
		modify(l,mid,h,root<<1);
		modify(mid,r,h,root<<1|1);
	}		
}
void find(int l,int r,int root)
{
	if(T[root].h)
	{
		ss+=(H[T[root].r]-H[T[root].l])*T[root].h;
		return ;
	}
	if(r!=l+1)
	{
		int mid=T[root].mid();
		find(l,mid,root<<1);
		find(mid,r,root<<1|1);
	}
}
int main()
{
	int i,j,k,n,m;
	while(scanf("%d",&n)==1)
	{
		ss=0;
		memset(M,0,sizeof(M));
		memset(F,0,sizeof(F));
		memset(H,0,sizeof(H));
		for(i=1;i<=n;i++)
		{
			scanf("%d%d%d",&M[i].x,&M[i].y,&M[i].h);
			F[2*i-1].s=M[i].x;F[2*i-1].n=i;F[2*i-1].flag=1;
			F[2*i].s=M[i].y;F[2*i].n=i;F[2*i].flag=0;
		}
		j=1;
		sort(F+1,F+2*n+1);
		H[1]=F[1].s;
		for(i=1;i<2*n;i++)
		{
			if(F[i].s!=F[i+1].s)
				H[++j]=F[i+1].s;
		}
		M[F[1].n].x=1;
		int s=1;
		for(i=2;i<=2*n;i++)
		{
			if(F[i].s!=F[i-1].s)
				s++;
			if(F[i].flag)
				M[F[i].n].x=s;
			else M[F[i].n].y=s;	
		}
		build(1,j,1);//printf("***\n");
		sort(M+1,M+n+1);
		for(i=1;i<=n;i++)
		{
			modify(M[i].x,M[i].y,M[i].h,1);
		}		
		find(1,j,1);
		printf("%I64d\n",ss);
	}
	return 0;
}
第二份代码:
#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <list>
#include <deque>
#include <set>
#include <numeric>
#include <functional>
#include <ctype.h>
using namespace std;

#define  max(a,b)  ((a)>(b)?(a):(b))
#define  min(a,b)  ((a)<(b)?(a):(b))

#define N 80010
typedef __int64 LL;
LL tree[N*4],hash[N*2];
//int z[40005][3];
LL ans;

struct Node
{
	int value,flag,pos;
	bool operator< (const Node &b) const
	{
		return value < b.value;
	}
}tt[N];
struct node
{
	int x,y,h;
	bool operator<(const node &b) const
	{
		return h<b.h;
	}
}z[40050];
void insert(int p,int l,int r,int ll,int rr,int h)
{
//	if( tree[p] >= h) return ;
	if(ll==l && rr==r)
	{
		tree[p] = max(h,tree[p]);
		return ;
	}
	if( tree[p] != -1 && tree[p] < h) 
	{
		tree[2*p]=tree[p]; tree[2*p+1]=tree[p];
		tree[p] = -1;
	}
	int mid= (l+r)>>1;
	if(rr <= mid) insert(2*p,l,mid,ll,rr,h);
	else if(ll > mid) insert(2*p+1,mid+1,r,ll,rr,h);
	else {
		insert(2*p,l,mid,ll,mid,h);
		insert(2*p+1,mid+1,r,mid+1,rr,h);
	}
}
void query(int p,int l,int r)
{
	
	if(tree[p] != -1)
	{
		ans += ((hash[r+1]-hash[l])*tree[p]);
		return ;
	}
	if(l==r) return ;
	int mid=(l+r)>>1;
	query(2*p,l,mid);
	query(2*p+1,mid+1,r);
}
int main()
{
    int n,i,j=0;
	while( scanf("%d",&n) == 1){
    j=0;
	memset(hash,0,sizeof(hash));
	
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&z[i].x,&z[i].y,&z[i].h);
		tt[j].value=z[i].x; tt[j].pos=i; tt[j++].flag=0;
		tt[j].value=z[i].y; tt[j].pos=i; tt[j++].flag=1;
	}
    sort(tt,tt+2*n);
	int index=1;
	hash[index]=tt[0].value;
	if(tt[0].flag)
	  z[tt[0].pos].y = index;
	else z[tt[0].pos].x=index;
	for(i=1;i<2*n;i++)
	{
		if(tt[i].value != tt[i-1].value)
		{
			index++;
			hash[index] = tt[i].value;
		}
		if(tt[i].flag)
		  z[tt[i].pos].y = index;
		else z[tt[i].pos].x=index;
	}
	sort(z,z+n);
	//for(i=0;i<n;i++) printf("%d %d %I64d %I64d %d\n",z[i][0],z[i][1],hash[z[i][0]],hash[z[i][1]],z[i][2]);
	//printf("-----------\n");
	memset(tree,-1,sizeof(tree));
    for(i=0;i<n;i++) insert(1,1,index-1,z[i].x,z[i].y-1,z[i].h);
    ans=0;
	query(1,1,index-1);
	printf("%I64d\n",ans);
	}
	return 0;
}
第三份代码:
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

int a[100000],b[100000],len;
__int64 sum;

struct node
{
	int l,r,h;
}t[400000],p[100000];

bool cmp(node Q,node P)
{
	return Q.h<P.h;
};

void build(int root,int l,int r)
{
	t[root].l=l,t[root].r=r,t[root].h=0;
	if(r-l==1)return ;
	int mid=(l+r)>>1;
	build(root<<1,l,mid);
	build(root<<1|1,mid,r);
}

void insert(int root,int l,int r,int h)
{
	if(l==t[root].l&&t[root].r==r)
	{
		t[root].h=h;
		return;
	}
	if(t[root].h>0)
	{
		t[root<<1].h=t[root].h;
		t[root<<1|1].h=t[root].h;
		t[root].h=0;
	}
	
	int mid=(t[root].l+t[root].r)>>1;
//	if(r>mid)insert(root<<1|1,l,r,h);
//	if(l<mid)insert(root<<1,l,r,h);
	if(r<=mid)insert(root<<1,l,r,h);
	else if(l>=mid)insert(root<<1|1,l,r,h);
	else
	{
		insert(root<<1,l,mid,h);
		insert(root<<1|1,mid,r,h);
	}
}

void search(int root)
{
	if(t[root].h>0)
	{
		sum+=(__int64)(b[t[root].r]-b[t[root].l])*t[root].h;
		return;
	}
	if(t[root].r-t[root].l==1)return ;
	search(root<<1);
	search(root<<1|1);

}

void div(int u)
{
	int i;
	sort(a+1,a+u);
	b[1]=a[1],len=1;
	for(i=2,len=2;i<u;i++)
	{
		
		if(a[i-1]!=a[i])
		{
			b[len]=a[i];
			len+=1;
		}
	}
}
int find(int x)
{
	int mid,l,r;
	l=1;
	r=len-1;
	while(l<=r)
	{	
		mid=(l+r)/2;
		if(x<b[mid])r=mid-1;
		else if(x>b[mid]) l=mid+1;
		else return mid;
	}
}

int main()
{
	int n,i=1,j;
	scanf("%d",&n);
	for(j=0;j<n;j++)
	{
		scanf("%d%d%d",&p[j].l,&p[j].r,&p[j].h);
		a[i++]=p[j].l;
		a[i++]=p[j].r;
	}
	div(i);
	build(1,1,len-1);
	sort(p,p+n,cmp);    //让高的后加,好覆盖前面低的。
	for(i=0;i<n;i++){
		insert(1,find(p[i].l),find(p[i].r),p[i].h);
	}
	sum=0;
	search(1);
	printf("%I64d\n",sum);
	return 0;
}
第四份代码:
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define MAX 40010
int a[MAX*2],turn;
struct rec{
	int l,r;
	int h;
}f[MAX];
struct ndoe{
	int l,r;
	int height;
	int mid()
	{
		return (l+r)>>1;
	}
}t[MAX*7];
bool cmp(rec x,rec y)
{
	return x.h<y.h;
}
void build(int l,int r,int root)
{
	t[root].l=l;
	t[root].r=r;
	t[root].height=-1;
	if(l+1==r)
		return ;
	int mid=t[root].mid();
	build(l,mid,root<<1);
	build(mid,r,root<<1|1);
}
void insert(int l,int r,int root,int h)
{
	if(t[root].height>=h)
		return ;
	if(l==t[root].l&&r==t[root].r)
	{
		if(t[root].height<h)
			t[root].height=h;
		return ;
	}
	if(t[root].height!=-1&&(t[root].l+1!=t[root].r))
	{
		t[root<<1].height=t[root<<1|1].height=t[root].height;
		t[root].height=-1;
	}
	int mid=t[root].mid();
	if(r<=mid)
		insert(l,r,root<<1,h);
	else if(l>=mid)
		insert(l,r,root<<1|1,h);
	else
	{
		insert(l,mid,root<<1,h);
		insert(mid,r,root<<1|1,h);
	}
}
__int64 query(int root)
{
	if(t[root].l+1==t[root].r&&t[root].height<0)
		return 0;
	if(t[root].height>0)	
		return t[root].height*(__int64)(a[t[root].r]-a[t[root].l]);
	else
		return query(root<<1)+query(root<<1|1);
}
int bsearch(int x)
{
	int left=0,right=turn-1;
	while(left<=right)
	{
		int mid=(left+right)>>1;
		if(a[mid]==x)
			return mid;
		else if(a[mid]>x)
			right=mid-1;
		else
			left=mid+1;
	}
	return -1;
}
int main()
{
	int n,i,x,y,z;
	while(scanf("%d",&n)!=EOF)
	{
		for(i=0;i<n;i++)
		{
			scanf("%d%d%d",&x,&y,&z);
			f[i].l=x;f[i].r=y;f[i].h=z;
			a[i*2]=f[i].l;
			a[i*2+1]=f[i].r;
		}
		sort(a,a+2*n);
		sort(f,f+n,cmp);
		turn=1;
		for(i=1;i<2*n;i++)
		{
			if(a[i]!=a[i-1])
				a[turn++]=a[i];
		}
		//printf("%d\n",turn);
		build(0,turn-1,1);
		for(i=0;i<n;i++)
		{
			//	printf("%d %d %d\n",bsearch(f[i].l),bsearch(f[i].r),f[i].h);
			insert(bsearch(f[i].l),bsearch(f[i].r),1,f[i].h);
		}
		__int64 ans;
		ans=query(1);
		printf("%I64d\n",ans);
	}
	return 0;
}
第五份代码:
#pragma warning (disable:4786)
#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <list>
#include <deque>
#include <set>
#include <numeric>
#include <functional>
#include <ctype.h>
#include <utility>
#include <cassert>
#include <time.h>
using namespace std;

#define Maxn 100010

__int64 ans=0;
__int64 v[500000];
__int64 xx[1000000];
struct no
{
	int a;int b;
	int hi;
}s[Maxn];

struct node
{
	__int64 pos;
	int num;
}a[1000000];

bool cmp1(struct node a,struct node b)
{
	return a.pos<b.pos;
}

bool cmp2(struct node a,struct node b)
{
	return a.num<b.num;
}

struct node1
{
	__int64 h;
	int l,r;
	__int64 lv,rv;
}T[Maxn*4];

void Build(int l,int r,int root)
{
	T[root].l=l;
	T[root].r=r;
	T[root].h=0;
	if(r-l==1)
	{
		T[root].lv=xx[l];
		T[root].rv=xx[r];
		return;
	}
	int Mid=(l+r)/2;
	Build(l,Mid,root*2);
	Build(Mid,r,root*2+1);
}

 void addadd(__int64 w,int l,int r,int root)
 {
	if(l==T[root].l&&r==T[root].r)
	{
	//	printf("*********\n");
		if(T[root].h<w)
			T[root].h=w;
		return;
	}
	int Mid=(T[root].l+T[root].r)/2;
	if(r<=Mid)
	{
		addadd(w,l,r,root*2);
	}
	else if(l>=Mid)
	{
		addadd(w,l,r,root*2+1);
	}
	else
	{
		addadd(w,l,Mid,root*2);
		addadd(w,Mid,r,root*2+1);
	}
 }

 void querysum(int h,int root)
 {
	if(h>T[root].h)
	T[root].h = h;
	if(T[root].l +1 == T[root].r)
	{
	  ans+=T[root].h *(xx[T[root].r] - xx[T[root].l]); 
	  return ;
	} 
	querysum(T[root].h,2*root);
	querysum(T[root].h,2*root+1); 	 
 }


 int main()
 {
	 int n,i;
	 scanf("%d",&n);
	for(i=0;i<n;i++)
	{
	int x,y,z;
	scanf("%d%d%d",&x,&y,&z);
	if(x>y) 
	{
	int temp=x;
	x=y;
	y=temp; 
	} 
	s[i].a=x;
	s[i].b=y;
	s[i].hi=z;
	a[i*2].pos=s[i].a;
	a[i*2].num=-(i+1);
	a[i*2+1].pos=s[i].b;
	a[i*2+1].num=i+1; 
	}
	 sort(a,a+2*n,cmp1);
	 int tp=1;
	 int temp=a[0].pos;
	 for(i=0;i<2*n;i++)
	 {
		 if(a[i].pos!=temp)
		 {
			 tp++;
			 temp=a[i].pos;
		 }
		 if(a[i].num<0)
		 {
			 xx[tp]=s[-a[i].num-1].a;
			 s[-a[i].num-1].a=tp;
		 }
		 else
		 {
			 xx[tp]=s[a[i].num-1].b;
			 s[a[i].num-1].b=tp;
		 }
	 }
	
//	 printf("k=%d\n",tp);
	 Build(1,tp,1); 
	 sort(a,a+2*n,cmp2);
	 for(i=0;i<n;i++)
		 addadd(s[i].hi,s[i].a,s[i].b,1);
	 querysum(0,1);
   	 printf("%I64d\n",ans);
	 return 0;
 }








The first building overlaps with the fourth building for an area of 1 square unit, so the total area is just 3*1 + 1*4 + 2*2 + 2*3 - 1 = 16.                      
The first building overlaps with the fourth building for an area of 1 square unit, so the total area is just 3*1 + 1*4 + 2*2 + 2*3 - 1 = 16.                      
The first building overlaps with the fourth building for an area of 1 square unit, so the total area is just 3*1 + 1*4 + 2*2 + 2*3 - 1 = 16.                      
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

City Horizon 的相关文章

  • 在 Haskell 中获取玫瑰树的根

    最近我开始学习 Haskell 并在以下练习中遇到困难 Write functions root Rose a gt a and children Rose a gt Rose a that return the value stored
  • 如何使用 --build 选项查看 cmake 发出的命令

    当我运行 cmake build target INSTALL 命令时 如何查看发出的命令 似乎没有像 versbose之类的选项 cmake 帮助说 cmake build 是底层构建工具的接口 但没有说明有关发出的命令转储的任何内容 我
  • 在许多驱动程序文件夹中创建 build-in.o

    我正在用我的自定义驱动程序构建内核 成功构建后 我发现了许多 build in o 文件 任何人都可以详细说明这些文件是如何在这里结束的吗 我只能怀疑这些与更高级别的 makefile 有关 built in o 文件是未构建为模块的内核的
  • SwiftUI - 使用“ObservableObject”和@EnvironmentObject 有条件地显示视图

    我想在我的应用程序中有条件地显示不同的视图 如果某个布尔值为 true 则将显示一个视图 如果为 false 将显示不同的视图 该布尔值位于 ObservableObject 类中 并根据将要显示的视图之一进行更改 PracticeStat
  • 如何从此 d3.js layout.tree 获取树祖先和树后代的列表?

    我正在尝试和修改this https bl ocks org mbostock 4339083d3 js 的示例 用于根据 JSON 树结构绘制树 这就是树的一部分开始时的样子 我正在尝试进行两个单独的修改 但我不知道该怎么做 当单击节点的
  • 结构填充和包装

    考虑 struct mystruct A char a int b char c x struct mystruct B int b char a y 结构的大小分别为 12 和 8 这些结构是填充的还是包装的 何时进行填充或包装 Padd
  • 有没有办法在 C 中按多个变量对结构进行排序?

    我必须编写一个对数组中的结构进行排序的函数 结构是 define MAX USERNAME LENGTH 16 typedef struct char username MAX USERNAME LENGTH unsigned int ri
  • MySQL - 从另一个表插入与常量合并的数据

    我有一个包含一些数据的临时表 products temp 并且我有另一个需要将数据插入其中的表 产品 我需要在新记录上手动设置一些常量 例如vendor id 1等 是否可以在一次请求中插入临时表数据和常量 临时产品 product nam
  • 从 CLI 部署 Maven 项目?

    在 IDE 中构建并运行良好 cd home thufir NetBeansProjects HelloMaven JAVA HOME usr lib jvm java 8 openjdk amd64 home thufir local s
  • 在 open CL 中将结构数组传递给内核

    你好 我正在尝试在 open CL 中实现距离向量程序 基本上我在将结构数组作为参数传递到内核时遇到问题 我的结构定义是这样的 typedef struct int a nodes 4 node node srcA 为此分配内存后 我使用此
  • 使用 jar 依赖项构建 Android 库项目

    我已经被一个问题困扰了几天 但我不知道如何解决这个问题 我正在处理一个 Android 库项目 该项目正在使用 android sdk 提供的 Android 工具进行编译 在项目内部 我遵循 Android 项目的标准结构 我的 jar
  • 是否可以在 Java 中创建对象树?

    我正在尝试用 Java 创建对象树 我还想使用一个 Java 类 可以轻松地在树中添加或删除节点 用于此目的的最佳类是什么 示例 这是一个对象数组 数组顶部的对象是字符串 world 这里的叶子是整数 我想添加字符串 This is at
  • 结构体到磁盘的高效 Go 序列化

    我的任务是将 C 代码替换为 Go 而且我对 Go API 还很陌生 我正在使用 gob 将数百个键 值条目编码到磁盘页面 但 gob 编码有太多不需要的膨胀 package main import bytes encoding gob f
  • 使用模块编译 TypeScript 并捆绑到一个文件

    当使用module inside tsconfig jsonTypeScript 编译器将忽略任何 out标记并生成常规输出 例如commonjs模块在单独的文件中 有没有办法将所有转译文件捆绑到一个文件中 我目前正在尝试使用 webpac
  • 通过命令行参数更改默认的 ant 目标

    最近我被分配了一个任务 让ant能够为不同的环境构建war包 除了一项功能外 我几乎完成了 蚂蚁接受一个env参数类似 Denv DEV 并使用不同的配置文件来制作war包 但默认目标是start它将构建 部署并启动 tomcat 我不希望
  • 仅导出嵌入结构实现的方法子集

    是否可以仅导出嵌入结构实现的方法的子集 这是一种与减少代码复制和粘贴非常不同的方法吗 还有更惯用的方法吗 type A struct func a A Hello fmt Println Hello func a A World fmt P
  • 打印附加结构(swift 4)

    我有三个 textifled 用于将数据附加到结构中 如何打印我附加的内容 现在我收到一条错误消息 import UIKit class ViewController UIViewController IBOutlet var c UITe
  • 如何自动为 Swift 类创建初始化程序?

    UPDATE 使用结构而不是类 struct 在很多方面都更好 它有自己的初始化器 这是我的模型课 是否有可能创建init自动方法 每次我都必须将所有变量一一初始化 这会花费很多时间 class Profile var id String
  • 一次分配多个字段的聪明方法?

    由于遗留函数调用 我有时被迫编写像这样的丑陋的包装器 function return someWrapper someField a someField a b someField b and so on realistically it
  • 团队构建 - 获取工作空间 - 从特定路径获取最新信息,而不是所有内容

    我有一个简单的构建定义 我想用它来构建一个项目 每次我选择运行此构建时 我都想从仅与相关项目相关的分支 目录中获取最新信息 我怎么做 对 获取工作空间 的调用得到一切来自源代码控制 并且出于各种原因 我不想 或需要 从所有内容中获取最新信息

随机推荐

  • 让合作伙伴拥有自己专属的刷脸支付品牌

    刷脸支付OEM合作模式即刷脸支付品牌定制 是行业内专业从事支付系统产品研发 在刷脸支付领域 具备强大的技术开发能力以及服务运营能力的公司 将目前成熟的产品系统框架进行品牌更换 让合作伙伴快速拥有自己专属的刷脸支付品牌 快速拓展市场 做刷脸支
  • Vue 解决路由重复 Uncaught (in promise)错误

    Holle 我是Boy 今天给大家分享一下关于 Vue 解决路由重复 Uncaught in promise 错误 的问题 话不多说直接来看 在脚手架router文件夹的index js写入 1 第一种方法 const routerPush
  • kubelet启动失败

    原因之一 是kubelet cgroup驱动程序 cgroupfs 与docker cgroup驱动程序不同 公司的k8s 新增了一个节点 但kubelet启动一直报错 无法启动 网上找了半天 发现是kubelet cgroup驱动程序 c
  • 机器学习之逻辑回归模型

    1 逻辑回归模型介绍 逻辑回归 Logistic Regression LR 又称为逻辑回归分析 是一种机器学习算法 属于分类和预测算法中的一种 主要用于解决二分类问题 逻辑回归通过历史数据的表现对未来结果发生的概率进行预测 例如 我们可以
  • openglStudySite

    http www learnopengles com android lesson one getting started
  • Python正则表达式_常用匹配方法findall

    正则匹配方法之findall 核心要点 findall 是将所有匹配到的字符 以列表的形式返回 如果未匹配 则返回空列表 一 pattern findall 方法 语法 findall string None pos 0 endpos 92
  • qt undefined reference to的原因之一

    在h文件定义的函数 参数带const 而在cpp文件中实现函数时 参数没有带const 则编译时所有调用该函数的地方会报undefined reference to错误 两者修改一致就好了 如 h文件定义的函数 void Test cons
  • 有意思的C编程题目

    有意思的C编程题目 有意思的编程 1 翻扑克 有52张朴克牌 使它们全部正面朝上 从第2张牌开始 把凡是2的倍数位置上的牌翻成正面朝下 接着从第3张牌开始 把凡是3的倍数位置上的牌正面朝上的翻成正面朝下 正面朝下的翻成正面朝上 接着从第4张
  • 工具链接记录

    工具链接记录 内网穿透 https gofrp org docs examples https2http
  • C/C++声明类型typedef

    typedef为现有类型定义易于记忆的类型名 即同义字 别名 它与传统C语言中 define很相似 下面我们就从实例中体会它的用处 1 常规变量类型定义 例如无符号整型标识符太长 为了自己后续方便 我希望起个自己认识又短小精简的名字 如下
  • Extremal Region(极值区域)文本定位与识别法-学习笔记(一)

    最近做一个计算机视觉的项目 要将其中复杂场景中的文本识别率从92 进一步提升 挑战很大也很有意思 边阅读一些最新的文本定位与识别的论文 边在这里记下阅读笔记与翻译内容 慢慢研究 本人英语与专业水平有限 仅供学习参考 欢迎交流 请多指教 Re
  • 网络基础:子网掩码划分2

    例子 例1 192 168 1 88 26传统方法 192 168 1 88 26 192 168 1 88 255 255 255 192 注意 26 255 255 255 11000000 255 255 255 192 传统方法 1
  • python:打包package

    简介 把模块打包成package 可以进行分发和安装 packaged的打包和安装 一 package层次架构 二 package的打包和安装 1 创建setup py 2 打包package 3 安装package 一 package层次
  • 设计模式--命令模式

    命令模式 属于行为型模式基本原理 请求以命令的形式包裹在对象中 并传给调用对象 调用对象寻找可以处理该命令的合适的对象 并把该命令传给相应的对象 该对象执行命令 主要流程 1 创建命令对象 该对象中包含请求 和执行请求 2 创建请求类 其中
  • 我问chatGPT,在JavaScript中构造函数和类的区别

    问 构造器函数和面向中的类是同样的东西吗 答 构造器函数和面向对象中的类并不是同样的东西 它们之间有些许不同 在面向对象编程中 类是一种抽象的概念 它描述了一类具有相同属性和行为的对象 类可以看作是对象的蓝图 包含了对象的属性和方法 而对象
  • 如何进行弱网测试?专项测试中最实用的方法了解一下……

    目录 引言 一 什么是弱网测试 二 为何要进行弱网测试 三 如何做弱网测试 四 弱网测试工具 引言 如今这个高度互联的时代里 网络环境对于应用程序的影响越来越重要 而弱网测试就是用来检验应用程序在恶劣网络环境下的表现 如果你是一名开发人员或
  • 【linux shell】服务器系统自动化巡检脚本资源状况统计

    运维服务器系统的时候需要定期检查服务器系统资源状况 如CPU 内存 硬盘这些资源消耗信息统计 在这种情况下也可以用开源的监控系统导出相应的需求信息或者直观的通过监控平台去查看资源状况 本文将介绍另一种方式通过Linux shell脚本实现服
  • 0xA00F4244<NoCamerasAttached>相机打不开解决办法

    0xA00F4244 NoCamerasAttached 依次排查 ctrl s 搜索 设备管理器 打开找到 照相机 如图1 如果为灰色 说明设置里头相机权限没有打开 可以去设置打开如图2 也可以fn f10 打开之后 返回 设备管理器 窗
  • 基于fasttext的新客服文本分类

    基于fasttext的新客服文本分类效果评估 具体步骤如下 数据处理 模型搭建 效果评估 结论 第一部分数据处理包括 数据读取 数据标准化格式处理 训练集和验证集数据准备 数据读取 import pandas as pd df pd rea
  • City Horizon

    http acm hust edu cn 8080 judge contest viewProblem action pid 45728 Description Farmer John has taken his cows on a tri