主席树的各类模板(区间第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.mzph.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;尝试了多种编码…