主席樹的各類模板(區間第k大數【動,靜】,區間不同數的個數,區間=k的個數)...

取板粗? ?好東西來的

?

1.(HDOJ2665)http://acm.hdu.edu.cn/showproblem.php?pid=2665

(POJ2104)http://poj.org/problem?id=2104

(POJ2761)http://poj.org/problem?id=2761

題意:求區間第K大,主席樹模板題

?

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=200010;
int tot,n,q,nowm;
int a[maxn],t[maxn];
int c[maxn<<5],lson[maxn<<5],rson[maxn<<5];
int T[maxn];void init_hash()
{for ( int i=1;i<=n;i++ ) t[i]=a[i];sort(t+1,t+1+n);nowm=unique(t+1,t+1+n)-(t+1);
}int hash_(int x)
{return lower_bound(t+1,t+1+nowm,x)-t;
}void build(int &root,int l,int r)
{root=++tot;if ( l==r ) return;int mid=(l+r)/2;build(lson[root],l,mid);build(rson[root],mid+1,r);
}void update(int root,int &rt,int p,int val,int l,int r)
{rt=++tot;lson[rt]=lson[root],rson[rt]=rson[root];c[rt]=c[root]+val;if ( l==r ) return;int mid=(l+r)/2;if ( p<=mid ) update(lson[rt],lson[rt],p,val,l,mid);else update(rson[rt],rson[rt],p,val,mid+1,r);
}int query(int rt_,int rt,int l,int r,int k)
{if ( l==r ) return l;int mid=(l+r)/2;int sum=c[lson[rt_]]-c[lson[rt]];if ( sum>=k ) return query(lson[rt_],lson[rt],l,mid,k);else return query(rson[rt_],rson[rt],mid+1,r,k-sum);
}int main()
{int Case;scanf("%d",&Case);while(Case++){scanf("%d%d",&n,&q);tot=0;for ( int i=1;i<=n;i++ ) scanf("%d",&a[i]);init_hash();build(T[0],1,nowm);for ( int i=1;i<=n;i++ ){int pos=hash_(a[i]);update(T[i-1],T[i],pos,1,1,nowm);}while ( q-- ){int l,r,k;scanf("%d%d%d",&l,&r,&k);printf("%d\n",t[query(T[r],T[l-1],1,nowm,k)]);}}return 0;
}
View Code

?

?

?

2.(HDOJ4417)http://acm.hdu.edu.cn/showproblem.php?pid=4417

題意:求給定區間<=k的數有多少

分析:在模板上將query部分修改一下即可,對于區間[L,R]來說,只需要將第R顆線段樹上的[0,k]區間內的值減去第L-1顆線段樹上對應區間即可。離線在線都行,離線做法需要將每次訪問的k也添加進入hash數組,而對于在線來說轉化后的數轉化前相對于給定的k來說只能變小不能變大即可

注意:題目給的區間范圍從0開始,要將其轉化成從1開始

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=1e5+10;
const int maxm=3e6+10;
int n,q,m,tot;
int a[maxn],t[maxn];
int T[maxn],lson[maxm],rson[maxm],c[maxm];void init_hash()
{for ( int i=1;i<=n;i++ ) t[i]=a[i];sort(t+1,t+1+n);m=unique(t+1,t+1+n)-(t+1);
}int build(int l,int r)
{int root=tot++;c[root]=0;if ( l!=r ){int mid=(l+r)/2;lson[root]=build(l,mid);rson[root]=build(mid+1,r);}return root;
}int hash_(int x)
{return lower_bound(t+1,t+1+m,x)-t;
}int update(int root,int pos,int val)
{int rt=tot++,tmp=rt;c[rt]=c[root]+val;int l=1,r=m;while ( l<r ){int mid=(l+r)/2;if ( pos<=mid ){lson[rt]=tot++;rson[rt]=rson[root];rt=lson[rt];root=lson[root];r=mid;}else {rson[rt]=tot++;lson[rt]=lson[root];rt=rson[rt];root=rson[root];l=mid+1;}c[rt]=c[root]+val;}return tmp;
}int query(int lrt,int rrt,int k)
{int ret=0;int l=1,r=m;while ( l<r ){int mid=(l+r)/2;if ( k<=mid ){r=mid;lrt=lson[lrt];rrt=lson[rrt];}else {ret+=c[lson[rrt]]-c[lson[lrt]];l=mid+1;lrt=rson[lrt];rrt=rson[rrt];}}ret+=c[rrt]-c[lrt];return ret;
}int main()
{int Case,h;scanf("%d",&Case);for ( h=1;h<=Case;h++ ){scanf("%d%d",&n,&q);tot=0;for ( int i=1;i<=n;i++ ) {scanf("%d",&a[i]);a[i]++;}init_hash();T[0]=build(1,m);for ( int i=1;i<=n;i++ ){int pos=hash_(a[i]);T[i]=update(T[i-1],pos,1);}printf("Case %d:\n",h);while ( q-- ){int l,r,k,p;scanf("%d%d%d",&l,&r,&k);l++,r++,k++;p=hash_(k);if ( t[p]>k ) p--;if ( p==0 ) printf("0\n");else printf("%d\n",query(T[l-1],T[r],p));}}return 0;
}HDOJ4417(在線)
在線
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=1e5+10;
const int maxm=3e6+10;
int n,q,m,tot;
int a[maxn],t[maxn*2],l[maxn],r[maxn],val[maxn];
int T[maxn],lson[maxm],rson[maxm],c[maxm];void init_hash()
{for ( int i=1;i<=n;i++ ) t[i]=a[i];for ( int i=1;i<=q;i++ ) t[i+n]=val[i];sort(t+1,t+1+n+q);m=unique(t+1,t+1+n+q)-(t+1);
}int build(int l,int r)
{int root=tot++;c[root]=0;if ( l!=r ){int mid=(l+r)/2;lson[root]=build(l,mid);rson[root]=build(mid+1,r);}return root;
}int hash_(int x)
{return lower_bound(t+1,t+1+m,x)-t;
}int update(int root,int pos,int val)
{int rt=tot++,tmp=rt;c[rt]=c[root]+val;int l=1,r=m;while ( l<r ){int mid=(l+r)/2;if ( pos<=mid ){lson[rt]=tot++;rson[rt]=rson[root];rt=lson[rt];root=lson[root];r=mid;}else {rson[rt]=tot++;lson[rt]=lson[root];rt=rson[rt];root=rson[root];l=mid+1;}c[rt]=c[root]+val;}return tmp;
}int query(int lrt,int rrt,int k)
{int ret=0;int l=1,r=m;while ( l<r ){int mid=(l+r)/2;if ( k<=mid ){r=mid;lrt=lson[lrt];rrt=lson[rrt];}else {ret+=c[lson[rrt]]-c[lson[lrt]];l=mid+1;lrt=rson[lrt];rrt=rson[rrt];}}ret+=c[rrt]-c[lrt];return ret;
}int main()
{int Case,h;scanf("%d",&Case);for ( h=1;h<=Case;h++ ){scanf("%d%d",&n,&q);tot=0;for ( int i=1;i<=n;i++ ) {scanf("%d",&a[i]);a[i]++;}for ( int i=1;i<=q;i++ ) {scanf("%d%d%d",&l[i],&r[i],&val[i]);l[i]++,r[i]++,val[i]++;}init_hash();T[0]=build(1,m);for ( int i=1;i<=n;i++ ){int pos=hash_(a[i]);T[i]=update(T[i-1],pos,1);}printf("Case %d:\n",h);for ( int i=1;i<=q;i++ ){int L,R,k;L=l[i],R=r[i],k=val[i];k=hash_(k);printf("%d\n",query(T[L-1],T[R],k));}}return 0;
}HDOJ4417(離線)
離線

3.(SPOJ3267)http://www.spoj.com/problems/DQUERY/

題意:給出一個長度為n 的數列,有q 個詢問,每個詢問給出數對 [i,j],需要你給出這一段中有多少不同的數字

分析:利用map記錄每個數的位置,主席樹建新樹的時候,如果當前元素出現過,那么把這個元素上次出現的位置減一,然后當前位置加一,如果沒出現過就是普通的建樹操作。

對于查詢[l, r]我們只需要取出第r棵樹,然后輸出這棵樹[l,r]之間的和,因為是按從1到n的順序插入的,所以每次只需要求>=l的個數即可

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
const int maxn=3e4+10;
const int maxm=3e6+10;
int n,q,tot;
int a[maxn];
int T[maxn],lson[maxm],rson[maxm],c[maxm];int build(int l,int r)
{int root=tot++;c[root]=0;if ( l!=r ){int mid=(l+r)/2;lson[root]=build(l,mid);rson[root]=build(mid+1,r);}return root;
}int update(int root,int pos,int val)
{int rt=tot++,tmp=rt;c[rt]=c[root]+val;int l=1,r=n;while ( l<r ){int mid=(l+r)/2;if ( pos<=mid ){lson[rt]=tot++;rson[rt]=rson[root];rt=lson[rt];root=lson[root];r=mid;}else {rson[rt]=tot++;lson[rt]=lson[root];rt=rson[rt];root=rson[root];l=mid+1;}c[rt]=c[root]+val;}return tmp;
}int query(int rt,int lpos)
{int ret=0;int l=1,r=n;while ( lpos>l ){int mid=(l+r)/2;if ( lpos<=mid ){r=mid;ret+=c[rson[rt]];rt=lson[rt];}else {rt=rson[rt];l=mid+1;}}return ret+c[rt];
}int main()
{int Case;while ( scanf("%d",&n)!=EOF ){tot=0;for ( int i=1;i<=n;i++ ) scanf("%d",&a[i]);T[0]=build(1,n);map<int,int>mp;for ( int i=1;i<=n;i++ ){if ( mp.find(a[i])!=mp.end() ) {int tmp=update(T[i-1],mp[a[i]],-1);T[i]=update(tmp,i,1);}else T[i]=update(T[i-1],i,1);mp[a[i]]=i;}scanf("%d",&q);while ( q-- ){int l,r;scanf("%d%d",&l,&r);printf("%d\n",query(T[r],l));}}return 0;
}SPOJ3267
View Code

4.(ZOJ2112)http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2112

題意:給定一串序列,有兩種操作,一種是求區間[l,r]第k大,另外一種是將a[i]=t

帶修改的主席樹

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=60010;
const int maxm=2500010;
int n,q,m,tot;
int a[maxn],t[maxn];
int T[maxn],lson[maxm],rson[maxm],c[maxm];
int S[maxn];
struct Query{int kind;int l,r,k;
}query[10010];void init_hash(int k)
{sort(t+1,t+k+1);m=unique(t+1,t+k+1)-(t+1);
}int hash_(int x)
{return lower_bound(t+1,t+m+1,x)-t;
}int build(int l,int r)
{int root=tot++;c[root]=0;if ( l!=r ){int mid=(l+r)/2;lson[root]=build(l,mid);rson[root]=build(mid+1,r);}return root;
}int update(int root,int pos,int val)
{int rt=tot++,tmp=rt;c[rt]=c[root]+val;int l=1,r=m;while ( l<r ){int mid=(l+r)/2;if ( pos<=mid ){lson[rt]=tot++;rson[rt]=rson[root];rt=lson[rt];root=lson[root];r=mid;}else {rson[rt]=tot++;lson[rt]=lson[root];rt=rson[rt];root=rson[root];l=mid+1;}c[rt]=c[root]+val;}return tmp;
}int lowbit(int x)
{return x&(-x);
}int used[maxn];
void add(int x,int pos,int val)
{while ( x<=n ){S[x]=update(S[x],pos,val);x+=lowbit(x);}
}int sum(int x)
{int ret=0;while ( x>0 ){ret+=c[lson[used[x]]];x-=lowbit(x);}return ret;
}int Q(int left,int right,int k)
{int lrt=T[left];int rrt=T[right];int l=1,r=m;for ( int i=left;i>0;i-=lowbit(i)) used[i]=S[i];for ( int i=right;i>0;i-=lowbit(i)) used[i]=S[i];while ( l<r ){int mid=(l+r)/2;int tmp=sum(right)-sum(left)+c[lson[rrt]]-c[lson[lrt]];if ( tmp>=k ){r=mid;for ( int i=left;i>0;i-=lowbit(i)) used[i]=lson[used[i]];for ( int i=right;i>0;i-=lowbit(i)) used[i]=lson[used[i]];lrt=lson[lrt];rrt=lson[rrt];}else {l=mid+1;k-=tmp;for ( int i=left;i>0;i-=lowbit(i)) used[i]=rson[used[i]];for ( int i=right;i>0;i-=lowbit(i)) used[i]=rson[used[i]];lrt=rson[lrt];rrt=rson[rrt];}}return l;
}int main()
{int Case;scanf("%d",&Case);while ( Case-- ){scanf("%d%d",&n,&q);tot=0;m=0;for ( int i=1;i<=n;i++ ) {scanf("%d",&a[i]);t[++m]=a[i];}char op[10];for ( int i=0;i<q;i++ ){scanf("%s",op);if ( op[0]=='Q' ){query[i].kind=0;scanf("%d%d%d",&query[i].l,&query[i].r,&query[i].k);}else{query[i].kind=1;scanf("%d%d",&query[i].l,&query[i].r);t[++m]=query[i].r;}}init_hash(m);T[0]=build(1,m);for ( int i=1;i<=n;i++ ){int pos=hash_(a[i]);T[i]=update(T[i-1],pos,1);}for ( int i=1;i<=n;i++ ) S[i]=T[0];for ( int i=0;i<q;i++ ){if ( query[i].kind==0 ) printf("%d\n",t[Q(query[i].l-1,query[i].r,query[i].k)]);else {add(query[i].l,hash_(a[query[i].l]),-1);add(query[i].l,hash_(query[i].r),1);a[query[i].l]=query[i].r;}}}return 0;
}ZOJ2112
View Code

5.(HDOJ4348)http://acm.hdu.edu.cn/showproblem.php?pid=4348

題意:給出一段長度為n的序列,有4種操作。初始時,時間戳=0

a.C l r d [l,r]區間內的數+d,時間戳++

b.Q l r 求當前時間戳下[l,r]區間的和

c.H l r t 求時間戳=t下[l,r]區間的和

d.B t? 時間戳=t

分析:推薦兩個講解較為詳細的博客https://blog.csdn.net/glqac/article/details/45103859

https://blog.csdn.net/kirito16/article/details/47266801

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const int maxn=1e5+10;
const int maxm=3e6+10;
int n,q,tot;
int a[maxn];
int T[maxn],lson[maxm],rson[maxm];
ll sum[maxm],add[maxm];int build(int l,int r)
{int root=tot++;add[root]=0;if ( l!=r ){int mid=(l+r)/2;lson[root]=build(l,mid);rson[root]=build(mid+1,r);}else{scanf("%lld",&sum[root]);return root;}sum[root]=sum[lson[root]]+sum[rson[root]];return root;
}void pushup(int rt,int len)
{sum[rt]=sum[lson[rt]]+sum[rson[rt]]+add[lson[rt]]*(len-len/2)+add[rson[rt]]*(len/2);
}int A,B;
ll val;int update(int root,int l,int r)
{int rt=tot++;add[rt]=add[root];if ( A<=l && r<=B ){sum[rt]=sum[root];add[rt]=add[root]+val;lson[rt]=lson[root];rson[rt]=rson[root];return rt;}int mid=(l+r)/2;if ( A<=mid ) lson[rt]=update(lson[root],l,mid);else lson[rt]=lson[root];if ( B>mid ) rson[rt]=update(rson[root],mid+1,r);else rson[rt]=rson[root];pushup(rt,r-l+1);return rt;
}ll query(int root,int l,int r,ll add_)
{if ( A<=l && r<=B ) return sum[root]+(add_+add[root])*(r-l+1);ll ans=0;int mid=(l+r)/2;if ( A<=mid ) ans+=query(lson[root],l,mid,add[root]+add_);if ( B>mid ) ans+=query(rson[root],mid+1,r,add[root]+add_);return ans;
}int main()
{char op[5];int now,Case=0;while ( scanf("%d%d",&n,&q)!=EOF ){if ( Case!=0 ) printf("\n");Case++;tot=0;T[0]=build(1,n);now=0;while ( q-- ){ll ans;int k;scanf("%s",op);if ( op[0]=='C' ) {scanf("%d%d%lld",&A,&B,&val);T[now+1]=update(T[now],1,n);now++;}else if ( op[0]=='Q' ){scanf("%d%d",&A,&B);ans=query(T[now],1,n,0); printf("%lld\n",ans);}else if ( op[0]=='H' ){scanf("%d%d%d",&A,&B,&k);ans=query(T[k],1,n,0); printf("%lld\n",ans);}else if ( op[0]=='B' ) {scanf("%d",&k);now=k;tot=T[now+1];}}}return 0;
}HDOJ4348
View Code

?

轉載于:https://www.cnblogs.com/shuaihui520/p/9742271.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/451107.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/451107.shtml
英文地址,請注明出處:http://en.pswp.cn/news/451107.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

java類內部的變量

類內部的變量分為兩部分&#xff1a; 一.類的成員變量 在類內部&#xff0c;變量定義部分&#xff0c;定義的變量。 二.局部變量 在類內方法體中定義的變量和方法中涉及的變量。 成員變量和局部變量的區別&#xff1a; &#xff08;1&#xff09;成員變量在整個類中都有效…

騰訊搜搜退出PC搜索領域:百度搜狗迎來雙龍競爭

摘要&#xff1a;據北京商報報道&#xff0c;上周末&#xff0c;騰訊對公司組織架構進行了大規模調整。業內普遍認為&#xff0c;搜搜并入騰訊無線后&#xff0c;這個獨立搜索平臺將被合并&#xff0c;失去獨立性&#xff0c;也將令搜搜官網域名soso.com走向“沒落”。據北京商…

facade-pattern外觀模式

外觀模式&#xff1a; 外觀模式是面向對象編程中的重要設計模式。外觀類用來掩蓋復雜的內部邏輯&#xff0c;為用戶提供簡潔統一的服務接口。外觀類的主要功能如下&#xff1a; 1.通過提供簡明的對外API接口&#xff0c;來提高程序的可閱讀性和間接性。 2.提供通用的特定功能…

Web Service 客戶端,調用服務方法

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 只是最簡單的調用web service 服務&#xff0c;至于要傳什么參數全看到業務了。 以下是最簡單的調用方式 &#xff1a; package hdmp…

分享Spring Cloud分布式微服務架構圖

分布式、微服務、云架構JAVA語言開發、跨平臺、高性能、高可用、安全、服務化、模塊化、組件化、驅動式開發模式 從現在開始&#xff0c;我這邊會將近期研發的springcloud微服務云架構的搭建過程和精髓記錄下來&#xff0c;幫助更多有興趣研發spring cloud框架的朋友&#xff0…

返回一個list的全部 倒敘排列的方法

#反向迭代一個listlist[2,4,6,4,3,7,5,45,23,6,5,32,6,52,324,23,65,76,3,234,6,3,4,356,7,74,234,35,7,86]def funrev(list): list1[] for i in range(len(list)): list1.append(list[-i-1]) print(list1) return list1print(************************)lis…

互聯網手機潮進入PK時代:周鴻祎激戰小米雷軍

摘要&#xff1a;事實上&#xff0c;周鴻祎本人也多次強調&#xff0c;對于對手他一向實事求是&#xff0c;“對小米手機這種模式持肯定態度&#xff0c;它是第一個做互聯網手機的”。花費精力做出漂亮的銷售業績&#xff0c;這是互聯網手機最關鍵命題&#xff0c;配置戰、價格…

很多人問為什么使用聯合索引,為什么不建兩個單獨的索引呢?

So why not just create two indexes, one on last_name and one on first_name? You could do that, but MySQL won’t use them both at the same time. In fact, MySQL will only ever use one index per table per query—except for UNIONs.[3] This fact is important e…

oracle表被鎖了怎么處理

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 首先你要知道表鎖住了是不是正常鎖&#xff1f;因為任何DML語句都會對表加鎖。你要先查一下是那個會話那個sql鎖住了表&#xff0c;有可…

Lyft Level 5 Challenge 2018 - Elimination Round翻車記

打猝死場感覺非常作死。 A&#xff1a;判一下起點和終點是否在其兩側即可。 #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; int read() {int x0,…

mysql用戶的權限分配

2019獨角獸企業重金招聘Python工程師標準>>> 因今天在分配數據庫權限的時候&#xff0c;同事反映賬戶不能使用函數&#xff0c;遂搜集資料總結了一番關于mysql用戶的權限分配。 MySQL 賦予用戶權限命令的簡單格式可概括為&#xff1a; grant 權限 on 數據庫對象 to …

小米360口水戰背后:國產手機第三態誕生

摘要&#xff1a;按照雙方公布的配置信息&#xff0c;小米手機青春版為1.2G H z雙核處理器&#xff0c;華為閃耀為1G H z雙核。種向市場投入海量推廣資金&#xff0c;以換取產品上的高利潤&#xff0c;代表為步步高、金立、O PPO。南都制圖&#xff1a;宋小偉 互聯網入侵通信業…

java bean轉map

一.使用Apache提供的BeanUtils public Map test(Object person) {Map map BeanUtils.describe(person);return map; } 二.使用Jackson public Map test(Object person) {ObjectMapper objectMapper new ObjectMapper(); Map map objectMapper.convertValue(person, HashM…

java中ftp文件上傳和中文亂碼解決

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 前幾天 有個需求就是上傳文件的時候&#xff0c;本地存一份&#xff0c;其他服務器也保存一份&#xff0c;于是就研究了一下&#xff0c…

線段與多邊形的關系

轉自周見智 介紹 最近項目中要用到有關幾何&#xff08;Geometry&#xff09;方面的知識&#xff0c;程序需要判斷給定的一條線段&#xff08;Segment&#xff09;與指定多邊形&#xff08;Polygon&#xff09;的位置關系。這種關系分為三種&#xff1a;多邊形包含線段、多邊形…

shell的交互式和非交互式登錄

工作中經常碰見環境變量加載問題&#xff0c;歸根結底就是配置文件的加載問題。 一般會有四種模式&#xff1a;交互式登陸、非交互式登陸、交互式非登陸、非交互非登陸。 交互式和非交互式對環境變量的加載: -------------------------------------------------- | …

運營商取消話費余額有效期后改收閑置費

摘要&#xff1a;截至昨天&#xff0c;北京的CDMA預付費手機用戶均收到了中國電信北京公司的短信通知。5月初&#xff0c;中國聯通正式取消有月租或有月最低消費的預付費產品的話費有效期。而邱寶昌認為&#xff0c;防止倒號和號碼資源浪費本應是運營商的責任&#xff0c;現在運…

內存柵欄的影響

當我們在使用jvm鎖的時候&#xff0c;一方面是為了減少線程的競爭&#xff0c;另外還有一方面就是保證共享數據的及時可見性。為了保證線程共享變量的可見性&#xff0c;會使用到內存柵欄&#xff0c;jvm設置內存柵欄&#xff0c;并將共享數據及時刷新到主存中保證其他線程可以…

hibernate連接數據庫配置

hibernate連接數據庫配置 1.連接mySql&#xff0c;文件配置如下&#xff1a; <?xml version"1.0" encoding"UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://…

解決,文件上傳到 ftp 服務器,中文出現亂碼問題

前些天發現了一個巨牛的人工智能學習網站&#xff0c;通俗易懂&#xff0c;風趣幽默&#xff0c;忍不住分享一下給大家。點擊跳轉到教程。 上傳到 ftp 服務器&#xff0c;中文出現亂碼解決&#xff0c;之前文件名 “ 網關信息 ” 始終不能正確顯示&#xff0c;嘗試了多種編碼…