A. Trip For Meal
给定一个三角形,你要在三角形上不断地走n步,可以走回头路,问你最短路是多少
贪心地走当前能走的最短边即可,模拟一百能过
代码:
#include <bits/stdc++.h> #define int long long #define sc(a) scanf("%lld",&a) #define scc(a,b) scanf("%lld %lld",&a,&b) #define sccc(a,b,c) scanf("%lld %lld %lld",&a,&b,&c) #define scs(a) scanf("%s",a) #define schar(a) scanf("%c",&a) #define pr(a) printf("%lld",a) #define fo(i,a,b) for(int i=a;i<b;++i) #define re(i,a,b) for(int i=a;i<=b;++i) #define rfo(i,a,b) for(int i=a;i>b;--i) #define rre(i,a,b) for(int i=a;i>=b;--i) #define prn() printf("\n") #define prs() printf(" ") #define mkp make_pair #define pii pair<int,int> #define pub(a) push_back(a) #define pob() pop_back() #define puf(a) push_front(a) #define pof() pop_front() #define fst first #define snd second #define frt front() #define bak back() #define mem0(a) memset(a,0,sizeof(a)) #define memmx(a) memset(a,0x3f3f,sizeof(a)) #define memmn(a) memset(a,-0x3f3f,sizeof(a)) #define debug #define db double #define yyes cout<<"YES"<<endl; #define nno cout<<"NO"<<endl; #define all(i,a) for(auto i=a.begin();i!=a.end();++i) using namespace std; typedef vector<int> vei; typedef vector<pii> vep; typedef map<int,int> mpii; typedef map<char,int> mpci; typedef map<string,int> mpsi; typedef deque<int> deqi; typedef deque<char> deqc; typedef priority_queue<int> mxpq; typedef priority_queue<int,vector<int>,greater<int> > mnpq; typedef priority_queue<pii> mxpqii; typedef priority_queue<pii,vector<pii>,greater<pii> > mnpqii; const int maxn=500005; const int inf=0x3f3f3f3f3f3f3f3f; const int MOD=100000007; const db eps=1e-10; const db pi=3.1415926535; int qpow(int a,int b){int tmp=a%MOD,ans=1;while(b){if(b&1){ans*=tmp,ans%=MOD;}tmp*=tmp,tmp%=MOD,b>>=1;}return ans;} int lowbit(int x){return x&-x;} int max(int a,int b){return a>b?a:b;} int min(int a,int b){return a<b?a:b;} int mmax(int a,int b,int c){return max(a,max(b,c));} int mmin(int a,int b,int c){return min(a,min(b,c));} void mod(int &a){a+=MOD;a%=MOD;} bool chk(int now){} int half(int l,int r){while(l<=r){int m=(l+r)/2;if(chk(m))r=m-1;else l=m+1;}return l;} int ll(int p){return p<<1;} int rr(int p){return p<<1|1;} int mm(int l,int r){return (l+r)/2;} int lg(int x){if(x==0) return 1;return (int)log2(x)+1;} bool smleql(db a,db b){if(a<b||fabs(a-b)<=eps)return true;return false;} bool bigeql(db a,db b){if(a>b||fabs(a-b)<=eps)return true;return false;} bool eql(db a,db b){if(fabs(a-b)<eps) return 1;return 0;} db len(db a,db b,db c,db d){return sqrt((a-c)*(a-c)+(b-d)*(b-d));} bool isp(int x){if(x==1)return false;if(x==2)return true;for(int i=2;i*i<=x;++i)if(x%i==0)return false;return true;} inline int read(){ char ch=getchar();int s=0,w=1; while(ch<48||ch>57){if(ch==‘-‘)w=-1;ch=getchar();} while(ch>=48&&ch<=57){s=(s<<1)+(s<<3)+ch-48;ch=getchar();} return s*w; } inline void write(int x){ if(x<0)putchar(‘-‘),x=-x; if(x>9)write(x/10); putchar(x%10+48); } int gcd(int a, int b){ if(a==0) return b; if(b==0) return a; if(!(a&1)&&!(b&1)) return gcd(a>>1,b>>1)<<1; else if(!(b&1)) return gcd(a,b>>1); else if(!(a&1)) return gcd(a>>1,b); else return gcd(abs(a-b),min(a,b)); } int lcm(int x,int y){return x*y/gcd(x,y);} int n,a,b,c; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0),cout.tie(0); cin>>n>>a>>b>>c; n--; int ans=0,now=1; while(n--){ if(now==1){ if(a<b) ans+=a,now=2; else ans+=b,now=3; } else if(now==2){ if(a<c) ans+=a,now=1; else ans+=c,now=3; } else if(now==3){ if(b<c) ans+=b,now=1; else ans+=c,now=2; } } cout<<ans; return 0; }
B. Yet Another Array Partitioning Task
给你一个序列,你要把它分成k段,每段的前m大数字会被记入答案的贡献当中,问你答案最大是多少
首先考虑前m*k大个数字应该都是要被选中的,答案应该就是他们的和
比较狗屎的是要输出分段的位置,我是用一个map存哪些数字要被输出,每输出了m个数字就分一次段
注意判断一下只输出k段
代码:
#include <bits/stdc++.h> #define int long long #define sc(a) scanf("%lld",&a) #define scc(a,b) scanf("%lld %lld",&a,&b) #define sccc(a,b,c) scanf("%lld %lld %lld",&a,&b,&c) #define scs(a) scanf("%s",a) #define schar(a) scanf("%c",&a) #define pr(a) printf("%lld",a) #define fo(i,a,b) for(int i=a;i<b;++i) #define re(i,a,b) for(int i=a;i<=b;++i) #define rfo(i,a,b) for(int i=a;i>b;--i) #define rre(i,a,b) for(int i=a;i>=b;--i) #define prn() printf("\n") #define prs() printf(" ") #define mkp make_pair #define pii pair<int,int> #define pub(a) push_back(a) #define pob() pop_back() #define puf(a) push_front(a) #define pof() pop_front() #define fst first #define snd second #define frt front() #define bak back() #define mem0(a) memset(a,0,sizeof(a)) #define memmx(a) memset(a,0x3f3f,sizeof(a)) #define memmn(a) memset(a,-0x3f3f,sizeof(a)) #define debug #define db double #define yyes cout<<"YES"<<endl; #define nno cout<<"NO"<<endl; #define all(i,a) for(auto i=a.begin();i!=a.end();++i) using namespace std; typedef vector<int> vei; typedef vector<pii> vep; typedef map<int,int> mpii; typedef map<char,int> mpci; typedef map<string,int> mpsi; typedef deque<int> deqi; typedef deque<char> deqc; typedef priority_queue<int> mxpq; typedef priority_queue<int,vector<int>,greater<int> > mnpq; typedef priority_queue<pii> mxpqii; typedef priority_queue<pii,vector<pii>,greater<pii> > mnpqii; const int maxn=500005; const int inf=0x3f3f3f3f3f3f3f3f; const int MOD=100000007; const db eps=1e-10; const db pi=3.1415926535; int qpow(int a,int b){int tmp=a%MOD,ans=1;while(b){if(b&1){ans*=tmp,ans%=MOD;}tmp*=tmp,tmp%=MOD,b>>=1;}return ans;} int lowbit(int x){return x&-x;} int max(int a,int b){return a>b?a:b;} int min(int a,int b){return a<b?a:b;} int mmax(int a,int b,int c){return max(a,max(b,c));} int mmin(int a,int b,int c){return min(a,min(b,c));} void mod(int &a){a+=MOD;a%=MOD;} bool chk(int now){} int half(int l,int r){while(l<=r){int m=(l+r)/2;if(chk(m))r=m-1;else l=m+1;}return l;} int ll(int p){return p<<1;} int rr(int p){return p<<1|1;} int mm(int l,int r){return (l+r)/2;} int lg(int x){if(x==0) return 1;return (int)log2(x)+1;} bool smleql(db a,db b){if(a<b||fabs(a-b)<=eps)return true;return false;} bool bigeql(db a,db b){if(a>b||fabs(a-b)<=eps)return true;return false;} bool eql(db a,db b){if(fabs(a-b)<eps) return 1;return 0;} db len(db a,db b,db c,db d){return sqrt((a-c)*(a-c)+(b-d)*(b-d));} bool isp(int x){if(x==1)return false;if(x==2)return true;for(int i=2;i*i<=x;++i)if(x%i==0)return false;return true;} inline int read(){ char ch=getchar();int s=0,w=1; while(ch<48||ch>57){if(ch==‘-‘)w=-1;ch=getchar();} while(ch>=48&&ch<=57){s=(s<<1)+(s<<3)+ch-48;ch=getchar();} return s*w; } inline void write(int x){ if(x<0)putchar(‘-‘),x=-x; if(x>9)write(x/10); putchar(x%10+48); } int gcd(int a, int b){ if(a==0) return b; if(b==0) return a; if(!(a&1)&&!(b&1)) return gcd(a>>1,b>>1)<<1; else if(!(b&1)) return gcd(a,b>>1); else if(!(a&1)) return gcd(a>>1,b); else return gcd(abs(a-b),min(a,b)); } int lcm(int x,int y){return x*y/gcd(x,y);} int n,m,k,a[maxn],b[maxn]; mpii mp; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0),cout.tie(0); cin>>n>>m>>k;re(i,1,n) cin>>a[i],b[i]=a[i]; sort(b+1,b+1+n,greater<int>()); int sum=0; re(i,1,m*k) sum+=b[i],mp[b[i]]++; cout<<sum<<endl; int cnt=0,can=0; re(i,1,n){ if(mp[a[i]]!=0){ cnt++; mp[a[i]]--; if(cnt==m){ cnt=0; cout<<i<<‘ ‘; can++; if(can==k-1) break; } } } return 0; }
C. Do you want a date?
对一个序列,他的每个子串的最大值减去最小值都要被计入答案,求答案
考虑把序列由小到大排序,然后看每个数字被加了几次或者减了几次
显然,某个数字作为最大值的情况是在他左边的数字任选,右边的数字一个都不选,作为最小值时相反
那么答案就是2的左边数字或者右边数字次幂,注意取模
代码:
#include <bits/stdc++.h> #define int long long #define sc(a) scanf("%lld",&a) #define scc(a,b) scanf("%lld %lld",&a,&b) #define sccc(a,b,c) scanf("%lld %lld %lld",&a,&b,&c) #define scs(a) scanf("%s",a) #define schar(a) scanf("%c",&a) #define pr(a) printf("%lld",a) #define fo(i,a,b) for(int i=a;i<b;++i) #define re(i,a,b) for(int i=a;i<=b;++i) #define rfo(i,a,b) for(int i=a;i>b;--i) #define rre(i,a,b) for(int i=a;i>=b;--i) #define prn() printf("\n") #define prs() printf(" ") #define mkp make_pair #define pii pair<int,int> #define pub(a) push_back(a) #define pob() pop_back() #define puf(a) push_front(a) #define pof() pop_front() #define fst first #define snd second #define frt front() #define bak back() #define mem0(a) memset(a,0,sizeof(a)) #define memmx(a) memset(a,0x3f3f,sizeof(a)) #define memmn(a) memset(a,-0x3f3f,sizeof(a)) #define debug #define db double #define yyes cout<<"YES"<<endl; #define nno cout<<"NO"<<endl; #define all(i,a) for(auto i=a.begin();i!=a.end();++i) using namespace std; typedef vector<int> vei; typedef vector<pii> vep; typedef map<int,int> mpii; typedef map<char,int> mpci; typedef map<string,int> mpsi; typedef deque<int> deqi; typedef deque<char> deqc; typedef priority_queue<int> mxpq; typedef priority_queue<int,vector<int>,greater<int> > mnpq; typedef priority_queue<pii> mxpqii; typedef priority_queue<pii,vector<pii>,greater<pii> > mnpqii; const int maxn=500005; const int inf=0x3f3f3f3f3f3f3f3f; const int MOD=1e9+7; const db eps=1e-10; const db pi=3.1415926535; int qpow(int a,int b){int tmp=a%MOD,ans=1;while(b){if(b&1){ans*=tmp,ans%=MOD;}tmp*=tmp,tmp%=MOD,b>>=1;}return ans;} int lowbit(int x){return x&-x;} int max(int a,int b){return a>b?a:b;} int min(int a,int b){return a<b?a:b;} int mmax(int a,int b,int c){return max(a,max(b,c));} int mmin(int a,int b,int c){return min(a,min(b,c));} void mod(int &a){a+=MOD;a%=MOD;} bool chk(int now){} int half(int l,int r){while(l<=r){int m=(l+r)/2;if(chk(m))r=m-1;else l=m+1;}return l;} int ll(int p){return p<<1;} int rr(int p){return p<<1|1;} int mm(int l,int r){return (l+r)/2;} int lg(int x){if(x==0) return 1;return (int)log2(x)+1;} bool smleql(db a,db b){if(a<b||fabs(a-b)<=eps)return true;return false;} bool bigeql(db a,db b){if(a>b||fabs(a-b)<=eps)return true;return false;} bool eql(db a,db b){if(fabs(a-b)<eps) return 1;return 0;} db len(db a,db b,db c,db d){return sqrt((a-c)*(a-c)+(b-d)*(b-d));} bool isp(int x){if(x==1)return false;if(x==2)return true;for(int i=2;i*i<=x;++i)if(x%i==0)return false;return true;} inline int read(){ char ch=getchar();int s=0,w=1; while(ch<48||ch>57){if(ch==‘-‘)w=-1;ch=getchar();} while(ch>=48&&ch<=57){s=(s<<1)+(s<<3)+ch-48;ch=getchar();} return s*w; } inline void write(int x){ if(x<0)putchar(‘-‘),x=-x; if(x>9)write(x/10); putchar(x%10+48); } int gcd(int a, int b){ if(a==0) return b; if(b==0) return a; if(!(a&1)&&!(b&1)) return gcd(a>>1,b>>1)<<1; else if(!(b&1)) return gcd(a,b>>1); else if(!(a&1)) return gcd(a>>1,b); else return gcd(abs(a-b),min(a,b)); } int lcm(int x,int y){return x*y/gcd(x,y);} int n,x[maxn]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0),cout.tie(0); cin>>n;re(i,1,n) cin>>x[i]; sort(x+1,x+1+n); int ans=0; re(i,1,n){ ans=(ans+qpow(2,i-1)*(x[i]%MOD))%MOD; ans=(ans+MOD-qpow(2,n-i)*(x[i]%MOD))%MOD; } cout<<ans; return 0; }
D. Coffee and Coursework (Hard Version)
你有n杯咖啡,每天可以喝任意多杯咖啡,每杯咖啡有一个贡献,但是喝的咖啡过多会有损益
喝第一杯咖啡损益为0,第二杯为1,第三杯以此类推
进入下一天时损益清零
你需要找到最少多少天可以使贡献大于等于一个给定的值
首先把贡献从大到小排序
考虑二分天数,在check答案时应该这样考虑,比如你有三天时间去完成任务,那么就让最大的三杯咖啡损益都为0
这样一定能找到当前天数下最多能达到多少贡献
代码:
#include <bits/stdc++.h> #define int long long #define sc(a) scanf("%lld",&a) #define scc(a,b) scanf("%lld %lld",&a,&b) #define sccc(a,b,c) scanf("%lld %lld %lld",&a,&b,&c) #define scs(a) scanf("%s",a) #define schar(a) scanf("%c",&a) #define pr(a) printf("%lld",a) #define fo(i,a,b) for(int i=a;i<b;++i) #define re(i,a,b) for(int i=a;i<=b;++i) #define rfo(i,a,b) for(int i=a;i>b;--i) #define rre(i,a,b) for(int i=a;i>=b;--i) #define prn() printf("\n") #define prs() printf(" ") #define mkp make_pair #define pii pair<int,int> #define pub(a) push_back(a) #define pob() pop_back() #define puf(a) push_front(a) #define pof() pop_front() #define fst first #define snd second #define frt front() #define bak back() #define mem0(a) memset(a,0,sizeof(a)) #define memmx(a) memset(a,0x3f3f,sizeof(a)) #define memmn(a) memset(a,-0x3f3f,sizeof(a)) #define debug #define db double #define yyes cout<<"YES"<<endl; #define nno cout<<"NO"<<endl; using namespace std; typedef vector<int> vei; typedef vector<pii> vep; typedef map<int,int> mpii; typedef map<char,int> mpci; typedef map<string,int> mpsi; typedef deque<int> deqi; typedef deque<char> deqc; typedef priority_queue<int> mxpq; typedef priority_queue<int,vector<int>,greater<int> > mnpq; typedef priority_queue<pii> mxpqii; typedef priority_queue<pii,vector<pii>,greater<pii> > mnpqii; const int maxn=500005; const int inf=0x3f3f3f3f3f3f3f3f; const int MOD=100000007; const db eps=1e-10; int qpow(int a,int b){int tmp=a%MOD,ans=1;while(b){if(b&1){ans*=tmp,ans%=MOD;}tmp*=tmp,tmp%=MOD,b>>=1;}return ans;} int lowbit(int x){return x&-x;} int max(int a,int b){return a>b?a:b;} int min(int a,int b){return a<b?a:b;} int mmax(int a,int b,int c){return max(a,max(b,c));} int mmin(int a,int b,int c){return min(a,min(b,c));} void mod(int &a){a+=MOD;a%=MOD;} bool chk(int now); int half(int l,int r){while(l<=r){int m=(l+r)/2;if(chk(m))r=m-1;else l=m+1;}return l;} int ll(int p){return p<<1;} int rr(int p){return p<<1|1;} int mm(int l,int r){return (l+r)/2;} int lg(int x){if(x==0) return 1;return (int)log2(x)+1;} bool smleql(db a,db b){if(a<b||fabs(a-b)<=eps)return true;return false;} bool bigeql(db a,db b){if(a>b||fabs(a-b)<=eps)return true;return false;} bool eql(db a,db b){if(fabs(a-b)<eps) return 1;return 0;} db len(db a,db b,db c,db d){return sqrt((a-c)*(a-c)+(b-d)*(b-d));} bool isp(int x){if(x==1)return false;if(x==2)return true;for(int i=2;i*i<=x;++i)if(x%i==0)return false;return true;} inline int read(){ char ch=getchar();int s=0,w=1; while(ch<48||ch>57){if(ch==‘-‘)w=-1;ch=getchar();} while(ch>=48&&ch<=57){s=(s<<1)+(s<<3)+ch-48;ch=getchar();} return s*w; } inline void write(int x){ if(x<0)putchar(‘-‘),x=-x; if(x>9)write(x/10); putchar(x%10+48); } int gcd(int a, int b){ if(a==0) return b; if(b==0) return a; if(!(a&1)&&!(b&1)) return gcd(a>>1,b>>1)<<1; else if(!(b&1)) return gcd(a,b>>1); else if(!(a&1)) return gcd(a>>1,b); else return gcd(abs(a-b),min(a,b)); } int lcm(int x,int y){return x*y/gcd(x,y);} int n,m,a[maxn]; int sum[maxn],del[maxn]; bool chk(int now){ re(i,1,now) del[i]=0; int cnt=0; re(i,1,n){ cnt+=a[i]-(i-1)/now; if(cnt>=m) return 1; } return 0; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0),cout.tie(0); cin>>n>>m;re(i,1,n) cin>>a[i],sum[i]=sum[i-1]+a[i]; if(sum[n]<m){ cout<<-1; return 0; } else if(sum[n]==m){ cout<<n; return 0; } sort(a+1,a+1+n,greater<int>()); cout<<half(1,n); return 0; }
E. Photo Processing
把序列分段,每段个数大于等于k,最小化每一段的最大值与最小值之差
n方的dp转移方程式是很好写的,如下:
dp[i]=min(dp[i],max(dp[j],a[i]-a[j+1]))
这里dp存的是最小的答案
但是这东西没法用单调队列维护,很鸡屎,我用各种乱七八糟方法都TLE,甚至猜测它是不是一个单峰函数
后来看题解,应该二分最大值与最小值之差
用dp[i]来表示1到i这个位置能不能有合法的分段方法
首先保证最大值最小值之差,然后保证每一段个数,合并的是[last,i]这个区间
最后看看dp[n]是否等于1就完事了
代码:
#include <bits/stdc++.h> #define int long long #define sc(a) scanf("%lld",&a) #define scc(a,b) scanf("%lld %lld",&a,&b) #define sccc(a,b,c) scanf("%lld %lld %lld",&a,&b,&c) #define scs(a) scanf("%s",a) #define schar(a) scanf("%c",&a) #define pr(a) printf("%lld",a) #define fo(i,a,b) for(int i=a;i<b;++i) #define re(i,a,b) for(int i=a;i<=b;++i) #define rfo(i,a,b) for(int i=a;i>b;--i) #define rre(i,a,b) for(int i=a;i>=b;--i) #define prn() printf("\n") #define prs() printf(" ") #define mkp make_pair #define pii pair<int,int> #define pub(a) push_back(a) #define pob() pop_back() #define puf(a) push_front(a) #define pof() pop_front() #define fst first #define snd second #define frt front() #define bak back() #define mem0(a) memset(a,0,sizeof(a)) #define memmx(a) memset(a,0x3f3f,sizeof(a)) #define memmn(a) memset(a,-0x3f3f,sizeof(a)) #define debug #define db double #define yyes cout<<"YES"<<endl; #define nno cout<<"NO"<<endl; #define all(i,a) for(auto i=a.begin();i!=a.end();++i) using namespace std; typedef vector<int> vei; typedef vector<pii> vep; typedef map<int,int> mpii; typedef map<char,int> mpci; typedef map<string,int> mpsi; typedef deque<int> deqi; typedef deque<char> deqc; typedef priority_queue<int> mxpq; typedef priority_queue<int,vector<int>,greater<int> > mnpq; typedef priority_queue<pii> mxpqii; typedef priority_queue<pii,vector<pii>,greater<pii> > mnpqii; const int maxn=500005; const int inf=0x3f3f3f3f3f3f3f3f; const int MOD=1e9+7; const db eps=1e-10; const db pi=3.1415926535; int qpow(int a,int b){int tmp=a%MOD,ans=1;while(b){if(b&1){ans*=tmp,ans%=MOD;}tmp*=tmp,tmp%=MOD,b>>=1;}return ans;} int lowbit(int x){return x&-x;} int max(int a,int b){return a>b?a:b;} int min(int a,int b){return a<b?a:b;} int mmax(int a,int b,int c){return max(a,max(b,c));} int mmin(int a,int b,int c){return min(a,min(b,c));} void mod(int &a){a+=MOD;a%=MOD;} bool chk(int now); int half(int l,int r){while(l<=r){int m=(l+r)/2;if(chk(m))r=m-1;else l=m+1;}return l;} int ll(int p){return p<<1;} int rr(int p){return p<<1|1;} int mm(int l,int r){return (l+r)/2;} int lg(int x){if(x==0) return 1;return (int)log2(x)+1;} bool smleql(db a,db b){if(a<b||fabs(a-b)<=eps)return true;return false;} bool bigeql(db a,db b){if(a>b||fabs(a-b)<=eps)return true;return false;} bool eql(db a,db b){if(fabs(a-b)<eps) return 1;return 0;} db len(db a,db b,db c,db d){return sqrt((a-c)*(a-c)+(b-d)*(b-d));} bool isp(int x){if(x==1)return false;if(x==2)return true;for(int i=2;i*i<=x;++i)if(x%i==0)return false;return true;} inline int read(){ char ch=getchar();int s=0,w=1; while(ch<48||ch>57){if(ch==‘-‘)w=-1;ch=getchar();} while(ch>=48&&ch<=57){s=(s<<1)+(s<<3)+ch-48;ch=getchar();} return s*w; } inline void write(int x){ if(x<0)putchar(‘-‘),x=-x; if(x>9)write(x/10); putchar(x%10+48); } int gcd(int a, int b){ if(a==0) return b; if(b==0) return a; if(!(a&1)&&!(b&1)) return gcd(a>>1,b>>1)<<1; else if(!(b&1)) return gcd(a,b>>1); else if(!(a&1)) return gcd(a>>1,b); else return gcd(abs(a-b),min(a,b)); } int lcm(int x,int y){return x*y/gcd(x,y);} int n,k,a[maxn],dp[maxn]; bool chk(int now){ mem0(dp); dp[0]=1; int last=1; re(i,1,n){ while(a[i]-a[last]>now) last++; while(i-last+1>=k){ if(dp[last-1]){ dp[i]=1; break; } last++; } } return dp[n]; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0),cout.tie(0); n=read(),k=read();re(i,1,n) a[i]=read(); sort(a+1,a+1+n); cout<<half(0,1e18); return 0; }
原文地址:https://www.cnblogs.com/oneman233/p/11600215.html