2018CCPC网络赛
A - Buy and Resell
1. spend aiai dollars to buy a Power Cube
2. resell a Power Cube and get aiai dollars if he has at least one Power Cube
3. do nothing
Obviously, Noswal can own more than one Power Cubes at the same time. After going to the nn cities, he will go back home and stay away from the cops. He wants to know the maximum profit he can earn. In the meanwhile, to lower the risks, he wants to minimize the times of trading (include buy and sell) to get the maximum profit. Noswal is a foxy and successful businessman so you can assume that he has infinity money at the beginning.
InputThere are multiple test cases. The first line of input contains a positive integer TT (T≤250T≤250), indicating the number of test cases. For each test case:
The first line has an integer nn. (1≤n≤1051≤n≤105)
The second line has nn integers a1,a2,…,ana1,a2,…,an where aiai means the trading price (buy or sell) of the Power Cube in the ii-th city. (1≤ai≤1091≤ai≤109)
It is guaranteed that the sum of all nn is no more than 5×1055×105.
OutputFor each case, print one line with two integers —— the maximum profit and the minimum times of trading to get the maximum profit.Sample Input
3
4
1 2 10 9
5
9 5 9 10 5
2
2 1
Sample Output
16 4
5 2
0 0
Hint
In the first case, he will buy in 1, 2 and resell in 3, 4. profit = - 1 - 2 + 10 + 9 = 16
In the second case, he will buy in 2 and resell in 4. profit = - 5 + 10 = 5
In the third case, he will do nothing and earn nothing. profit = 0
利用pq贪心去看看那天选择了
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define lson l,(l+r)/2,rt<<1
#define rson (l+r)/2+1,r,rt<<1|1
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define pb push_back
#define val first
#define pos second
#define ll long long
#define sz(x) (int)(x).size()
#define pll pair<long long,long long>
#define pii pair<int,int>
const int N=1e5+,MD=1e9+,INF=0x3f3f3f3f;
const ll LL_INF=0x3f3f3f3f3f3f3f3f;
const double eps=1e-,e=exp(),PI=acos(-.);
struct T
{
int v,cnt;
friend bool operator <(T a,T b)
{
if(a.v==b.v) return a.cnt<b.cnt;
return a.v>b.v;
}
};
priority_queue<T>Q;
int main()
{
ios::sync_with_stdio(false),cin.tie(),cout.tie();
int T,n;
cin>>T;
while(T--)
{
cin>>n;
ll ans=,cnt=;
for(int i=,x,y; i<=n; i++)
{
cin>>x;
if(!Q.empty())
{
y=Q.top().v;
if(y<x)Q.pop(),ans+=x-y,Q.push({x,});
}
Q.push({x,});
}
while(!Q.empty())cnt+=Q.top().cnt,Q.pop();
cout<<ans<<" "<<cnt*<<"\n";
}
return ;
}
CF上的神仙代码
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define lson l,(l+r)/2,rt<<1
#define rson (l+r)/2+1,r,rt<<1|1
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define pb push_back
#define val first
#define pos second
#define ll long long
#define sz(x) (int)(x).size()
#define pll pair<long long,long long>
#define pii pair<int,int>
const int N=1e5+,MD=1e9+,INF=0x3f3f3f3f;
const ll LL_INF=0x3f3f3f3f3f3f3f3f;
const double eps=1e-,e=exp(),PI=acos(-.);
multiset<pll> pq,se1,se2;
int main()
{
ios::sync_with_stdio(false),cin.tie(),cout.tie();
int T,n;
cin>>T;
while(T--)
{
pq.clear(),se1.clear(),se2.clear();
cin>>n;
for(int i=,x,y; i<=n; i++)
{
cin>>x;
pq.insert({x, i});
y=(*pq.begin()).val;
if(y<x)
{
if(se2.empty()||(*se2.begin()).val>y)
{
se1.insert(*pq.begin());
pq.erase(pq.begin());
se2.insert({x,i});
pq.erase(pq.find({x,i}));
}
else
{
pq.insert(*se2.begin());
se2.erase(se2.begin());
se2.insert({x,i});
pq.erase(pq.find({x,i}));
}
}
else if(!se2.empty()&&(*se2.begin()).val < x)
{
pq.insert(*se2.begin());
se2.erase(se2.begin());
se2.insert({x,i});
pq.erase(pq.find({x,i}));
}
}
ll a=;
for(auto X:se1)a-=X.val;
for(auto X:se2) a+=X.val;
cout<<a<<" "<<se1.size()+se2.size()<<endl;
}
return ;
}
C - Dream
For instance, (1+4)2=52=25(1+4)2=52=25, but 12+42=17≠2512+42=17≠25. Moreover, 9+16−−−−−√=25−−√=59+16=25=5, which does not equal 3+4=73+4=7.
Fortunately, in some cases when pp is a prime, the identity
holds true for every pair of non-negative integers m,nm,n which are less than pp, with appropriate definitions of addition and multiplication.
You are required to redefine the rules of addition and multiplication so as to make the beginner's dream realized.
Specifically, you need to create your custom addition and multiplication, so that when making calculation with your rules the equation (m+n)p=mp+np(m+n)p=mp+np is a valid identity for all non-negative integers m,nm,n less than pp. Power is defined as
Obviously there exists an extremely simple solution that makes all operation just produce zero. So an extra constraint should be satisfied that there exists an integer q(0<q<p)q(0<q<p) to make the set {qk|0<k<p,k∈Z}{qk|0<k<p,k∈Z} equal to {k|0<k<p,k∈Z}{k|0<k<p,k∈Z}. What's more, the set of non-negative integers less than pp ought to be closed under the operation of your definitions.
Hint for sample input and output:
From the table we get 0+1=10+1=1, and thus (0+1)2=12=1⋅1=1(0+1)2=12=1⋅1=1. On the other hand, 02=0⋅0=002=0⋅0=0, 12=1⋅1=112=1⋅1=1, 02+12=0+1=102+12=0+1=1.
They are the same.
InputThe first line of the input contains an positive integer T(T≤30)T(T≤30)indicating the number of test cases.
For every case, there is only one line contains an integer p(p<210)p(p<210), described in the problem description above. pp is guranteed to be a prime.
OutputFor each test case, you should print 2p2p lines of pp integers.
The jj-th(1≤j≤p1≤j≤p) integer of ii-th(1≤i≤p1≤i≤p) line denotes the value of (i−1)+(j−1)(i−1)+(j−1). The jj-th(1≤j≤p1≤j≤p) integer of (p+i)(p+i)-th(1≤i≤p1≤i≤p) line denotes the value of (i−1)⋅(j−1)(i−1)⋅(j−1).
Sample Input
1
2
Sample Output
0 1
1 0
0 0
0 1
构造一个群满足上述条件
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define lson l,(l+r)/2,rt<<1
#define rson (l+r)/2+1,r,rt<<1|1
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define pb push_back
#define fi first
#define se second
#define ll long long
#define sz(x) (int)(x).size()
#define pll pair<long long,long long>
#define pii pair<int,int>
#define pq priority_queue
const int N=1e5+,MD=1e9+,INF=0x3f3f3f3f;
const ll LL_INF=0x3f3f3f3f3f3f3f3f;
const double eps=1e-,e=exp(),PI=acos(-.);
int a[N];
int main()
{
ios::sync_with_stdio(false),cin.tie(),cout.tie();
int T;
cin>>T;
while(T--)
{
int p;
cin>>p;
for(int i=; i<p; i++)
{
for(int j=; j<p; j++)
cout<<" "<<(i+j)%p;
cout<<"\n";
}
for(int i=; i<p; i++)
{
for(int j=; j<p; j++)
cout<<" "<<(i*j)%p;
cout<<"\n";
}
}
return ;
}
E - GuGu Convolution
Given a series {a}=(a0,a1,a2,⋯){a}=(a0,a1,a2,⋯), we can easily define its exponential generating function as g{a}(x)=∑i=0∞aii!xig{a}(x)=∑i=0∞aii!xi.
Now we define a series {uc}=(c0,c1,c2,⋯){uc}=(c0,c1,c2,⋯) and let ecec represents the ucuc with 00 filled in all its even items. Formally, {ec}=(0,c1,0,c3,0,c5,⋯){ec}=(0,c1,0,c3,0,c5,⋯).
'Do you know convolution?'
'GU GU.' GuGu utters.
'Well, let me show you.
Given two generating function g{a}g{a} and g{b}g{b}, the convolution can be represented as G(x)=(g{a}∗g{b})(x)=∑n=0∞(∑i+j=naibj)xnG(x)=(g{a}∗g{b})(x)=∑n=0∞(∑i+j=naibj)xn.
It is quite easy, right?'
'GU GU.' GuGu utters.
'Ok. Now you have to find the coefficient of xnxn of the convolution G(x)=(g{uA}∗g{eB√})G(x)=(g{uA}∗g{eB}), given nn, AA and BB.
Let GnGn representes that coefficient, you should tell me n!Gnn!Gn.
You may know the severity of unsolving this problem.'
As GuGu is not that kind of good for it, it turns to you for help.
'GU GU!' GuGu thanks.
First Sample: 1!(100!1–√11!+111!00!)=11–√1!(100!111!+111!00!)=11
Second Sample: 2!(52300!02!+52311!12−−√11!+52322!00!)=20923–√2!(52300!02!+52311!1211!+52322!00!)=20923
P.S.: 104612−−√104612 is equal to the answer. However, 1212 has a factor 4=224=22 so it can't be output directly.
InputThere is an integer TT in the first line, representing the number of cases.
Then followed TT lines, and each line contains four integers A,B,n,pA,B,n,p. The meaning of A,B,nA,B,n is described above, and that of ppwill be described in Output session.
1≤T≤1051≤T≤105
1≤A,B≤1061≤A,B≤106
1≤n≤10181≤n≤1018
1≤p≤1091≤p≤109OutputLet ∑i=1qaibi−−√∑i=1qaibi represents the answer, with bi≠bj,gcd(bi,bj)=1,1≤i<j≤qbi≠bj,gcd(bi,bj)=1,1≤i<j≤q, and none of bibi's factors is square number.
Print TT lines only. Each line comes with a number qq and followed qqpairs of integers aiai bibi, with bibi in increasing order. Since aiai may be large, please print ai%pai%p instead. All integers in the same line should be seperated by exactly one space.
You may find that each answer is unique.
Sample Input
3
1 1 1 7
523 12 2 2100
1 1 1000000000000000000 998244353
Sample Output
1 1 1
1 2092 3
1 121099884 1
公式变换,然后作差
为了避免求逆出现问题,*2又/2
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int>v;
bool f[];
int la(int n)
{
if(n==) return ;
int res=;
for(auto i:v)
{
if(n%i==)
{
int num=;
while(n%i==)
{
n/=i;
if(num&) res*=i;
num++;
}
}
if(i*i>n) break;
}
return res;
} ll qmi(ll p,ll q,ll n,ll mod,ll B)
{
ll a=,b=,t1,t2;
while(n)
{
if (n&)
{
t1=(a*p+b*q%mod*B)%mod;
t2=(a*q+b*p)%mod;
a=t1;
b=t2;
}
t1=(p*p+q*q%mod*B)%mod;
t2=(p*q*)%mod;
p=t1;
q=t2;
n>>=;
}
return b;
}
int main()
{
for(int i=; i<; i++)
if(!f[i])
{
v.push_back(i);
for (int j=i+i; j<; j+=i) f[j]=;
}
ios::sync_with_stdio(false),cin.tie(),cout.tie();
int T;
ll n,A,B,p,ans;
cin>>T;
while(T--)
{
cin>>A>>B>>n>>p;
p*=;
ans=(qmi(A,,n,p,B)-qmi(A,-,n,p,B)+p)%p;
ans/=,p/=;
int k=la(B);
cout<<<<" "<<ans*k%p<<" "<<B/k/k<<"\n";
}
}
G - Neko's loop
The loop has a happy value aiai on the i−th(0≤i≤n−1)i−th(0≤i≤n−1) grid.
Neko likes to jump on the loop.She can start at anywhere. If she stands at i−thi−th grid, she will get aiai happy value, and she can spend one unit energy to go to ((i+k)modn)−th((i+k)modn)−th grid. If she has already visited this grid, she can get happy value again. Neko can choose jump to next grid if she has energy or end at anywhere.
Neko has mm unit energies and she wants to achieve at least ss happy value.
How much happy value does she need at least before she jumps so that she can get at least ss happy value? Please note that the happy value which neko has is a non-negative number initially, but it can become negative number when jumping.
InputThe first line contains only one integer T(T≤50)T(T≤50), which indicates the number of test cases.
For each test case, the first line contains four integers n,s,m,k(1≤n≤104,1≤s≤1018,1≤m≤109,1≤k≤n)n,s,m,k(1≤n≤104,1≤s≤1018,1≤m≤109,1≤k≤n).
The next line contains nn integers, the i−thi−th integer is ai−1(−109≤ai−1≤109)ai−1(−109≤ai−1≤109)
OutputFor each test case, output one line "Case #x: y", where x is the case number (starting from 1) and y is the answer.Sample Input
2
3 10 5 2
3 2 1
5 20 6 3
2 3 2 1 5
Sample Output
Case #1: 0
Case #2: 2
求一个环的最大值,有两种情况,用滑窗维护下吧
#include<bits/stdc++.h>
using namespace std;
const int MAX=1e4+;
const int MOD=1e9+;
const double PI=acos(-1.0);
typedef long long ll;
ll a[MAX];
ll sum[MAX];
int v[MAX];
vector<ll>p;
deque<int>que;
ll cal(ll m)
{
int len=p.size();
for(int i=; i<len; i++)p.push_back(p[i]); //扩大2倍
for(int i=; i<p.size(); i++)sum[i]=(i==?p[i]:sum[i-]+p[i]);
int y=m%len;
ll ans=;
while(!que.empty())que.pop_back();
for(int i=,R=; i<len; i++) //先走m/len圈
{
while(!que.empty()&&que.back()<i)que.pop_back();
while(R<=i+y-)
{
while(!que.empty()&&sum[que.front()]<=sum[R])que.pop_front();
que.push_front(R);
R++;
}
int x=que.back();
ll res=max(0ll,sum[x]-(i==?:sum[i-]));
ans=max(ans,res+max(0ll,m/len*sum[len-]));
}
if(m>=len) //先找到最大值所需步数x,再走(m-x)/len圈
{
while(!que.empty())que.pop_back();
for(int i=,R=; i<len; i++)
{
while(!que.empty()&&que.back()<i)que.pop_back();
while(R<=i+len-)
{
while(!que.empty()&&sum[que.front()]<=sum[R])que.pop_front();
que.push_front(R);
R++;
}
int x=que.back();
ll res=max(0ll,sum[x]-(i==?:sum[i-]));
ans=max(ans,res+max(0ll,(m-(x-i+))/len*sum[len-]));
}
}
return ans;
}
int main()
{
int T,cas=;
cin>>T;
while(T--)
{
ll n,s,m,k;
scanf("%lld%lld%lld%lld",&n,&s,&m,&k);
for(int i=; i<n; i++)scanf("%lld",&a[i]);
for(int i=; i<n; i++)v[i]=;
ll ans=s;
for(int i=; i<n; i++)
{
if(v[i])continue;
p.clear();
int j=i;
while(v[j]==) //找出循环节里的数并计算答案
{
v[j]=;
p.push_back(a[j]);
j=(j+k)%n;
}
ans=min(ans,max(s-cal(m),0ll));
}
printf("Case #%d: %lld\n",cas++,ans);
}
return ;
}
I - Tree and Permutation
The set { 1,2,3,…,N1,2,3,…,N } contains a total of N!N! unique permutations, let’s say the ii-th permutation is PiPi and Pi,jPi,j is its jj-th number.
For the ii-th permutation, it can be a traverse sequence of the tree with NN vertices, which means we can go from the Pi,1Pi,1-th vertex to the Pi,2Pi,2-th vertex by the shortest path, then go to the Pi,3Pi,3-th vertex ( also by the shortest path ) , and so on. Finally we’ll reach the Pi,NPi,N-th vertex, let’s define the total distance of this route as D(Pi)D(Pi) , so please calculate the sum of D(Pi)D(Pi) for all N!N!permutations.
InputThere are 10 test cases at most.
The first line of each test case contains one integer NN ( 1≤N≤1051≤N≤105 ) .
For the next N−1N−1 lines, each line contains three integer XX, YY and LL, which means there is an edge between XX-th vertex and YY-th of length LL ( 1≤X,Y≤N,1≤L≤1091≤X,Y≤N,1≤L≤109 ) .OutputFor each test case, print the answer module 109+7109+7 in one line.Sample Input
3
1 2 1
2 3 1
3
1 2 1
1 3 2
Sample Output
16
24
求出两两间距离之和,在n!个排列里,两两相邻是(n-1)!
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define lson l,(l+r)/2,rt<<1
#define rson (l+r)/2+1,r,rt<<1|1
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define pb push_back
#define v first
#define w second
#define ll long long
#define sz(x) (int)(x).size()
#define pll pair<long long,long long>
#define pii pair<int,int>
#define pq priority_queue
const int N=1e5+,MD=1e9+,INF=0x3f3f3f3f;
const ll LL_INF=0x3f3f3f3f3f3f3f3f;
const double eps=1e-,e=exp(),PI=acos(-.);
vector<pair<int,int> > tree[N];
ll dp[N],sum[N];//统计每个点子树所包含点的个数
int n;
void dfs(int cur,int fa)
{
sum[cur] = ;
for(int i = ; i<tree[cur].size(); i++)
{
int son=tree[cur][i].v;
ll len=tree[cur][i].w;
if(fa==son)continue;
dfs(son,cur);
sum[cur]+=sum[son];
dp[cur]+=dp[son]+sum[son]*(n-sum[son])%MD*len%MD;
dp[cur]%=MD;
}
}
int main()
{
while(~scanf("%d",&n))
{
ll ans=;
memset(dp,,sizeof(dp)),memset(sum,,sizeof(sum));
for(int i = ,u,v,w; i<n; i++)
{
ans=ans*i%MD;
scanf("%d%d%d",&u,&v,&w);
tree[u].push_back({v,w});
tree[v].push_back({u,w});
}
dfs(,);
for(int i=; i<=n; i++)tree[i].clear();
printf("%d\n",ans*dp[]%MD);
}
return ;
}
J - YJJ's Salesman
One day, he is going to travel from city A to southeastern city B. Let us assume that A is (0,0)(0,0) on the rectangle map and B (109,109)(109,109). YJJ is so busy so he never turn back or go twice the same way, he will only move to east, south or southeast, which means, if YJJ is at (x,y)(x,y) now (0≤x≤109,0≤y≤109)(0≤x≤109,0≤y≤109), he will only forward to (x+1,y)(x+1,y), (x,y+1)(x,y+1) or (x+1,y+1)(x+1,y+1).
On the rectangle map from (0,0)(0,0) to (109,109)(109,109), there are several villages scattering on the map. Villagers will do business deals with salesmen from northwestern, but not northern or western. In mathematical language, this means when there is a village kk on (xk,yk)(xk,yk) (1≤xk≤109,1≤yk≤109)(1≤xk≤109,1≤yk≤109), only the one who was from (xk−1,yk−1)(xk−1,yk−1) to (xk,yk)(xk,yk) will be able to earn vkvk dollars.(YJJ may get different number of dollars from different village.)
YJJ has no time to plan the path, can you help him to find maximum of dollars YJJ can get.
InputThe first line of the input contains an integer TT (1≤T≤10)(1≤T≤10),which is the number of test cases.
In each case, the first line of the input contains an integer NN (1≤N≤105)(1≤N≤105).The following NN lines, the kk-th line contains 3 integers, xk,yk,vkxk,yk,vk (0≤vk≤103)(0≤vk≤103), which indicate that there is a village on (xk,yk)(xk,yk) and he can get vkvk dollars in that village.
The positions of each village is distinct.OutputThe maximum of dollars YJJ can get.Sample Input
1
3
1 1 1
1 2 2
3 3 1
Sample Output
3
离散化就可以用数据结构去维护这个dp了
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+;
struct T
{
int x,y,v;
} t[N];
bool cmp(T a, T b)
{
return a.x<b.x;
}
int a[N],c[N];
int tot;
void update(int i, int val)
{
for(; i<=tot; i+=i&(-i))c[i]=max(c[i], val);
}
int query(int i)
{
int res=;
for(; i>; i-=i&(-i))res = max(res, c[i]);
return res;
}
int dp[N];
int main()
{
int T,n;
scanf("%d", &T);
while (T--)
{
scanf("%d", &n);
for(int i=; i<n; i++)scanf("%d%d%d",&t[i].x,&t[i].y,&t[i].v);
tot=,memset(c,,sizeof c);
for(int i=; i<n; i++)a[tot++]=t[i].y;
sort(a,a+tot);
tot=unique(a,a+tot)-a;
for(int i=; i<n; i++)t[i].y=lower_bound(a,a+tot,t[i].y)-a+;
sort(t,t+n,cmp);
for(int i=; i<n; i++) dp[i]=t[i].v;
int pos=,ans=;
for(int i=; i<n; i++)
{
while(pos<i&&t[pos].x<t[i].x)update(t[pos].y,dp[pos]),pos++;
dp[i]=query(t[i].y-)+t[i].v,ans=max(ans,dp[i]);
}
printf("%d\n",ans);
}
return ;
}
2018CCPC网络赛的更多相关文章
- hdu6440 Dream 2018CCPC网络赛C 费马小定理+构造
题目传送门 题目大意: 给定一个素数p,让你重载加法运算和乘法运算,使(m+n)p=mp+np,并且 存在一个小于p的q,使集合{qk|0<k<p,k∈Z} 等于集合{k|0<k&l ...
- hdu6446 Tree and Permutation 2018ccpc网络赛 思维+dfs
题目传送门 题目描述:给出一颗树,每条边都有权值,然后列出一个n的全排列,对于所有的全排列,比如1 2 3 4这样一个排列,要算出1到2的树上距离加2到3的树上距离加3到4的树上距离,这个和就是一个排 ...
- 2018CCPC网络赛A(优先队列,思维)
#include<bits/stdc++.h>using namespace std;priority_queue<pair<int,int>>q;int main ...
- HDU6438 Buy and Resell 2018CCPC网络赛 -低买高卖-贪心经典题
目录 Catalog Solution: (有任何问题欢迎留言或私聊 && 欢迎交流讨论哦 Catalog Problem:Portal传送门 原题目描述在最下面. 出过很多次:5 ...
- HDU6440 Dream 2018CCPC网络赛-费马小定理
目录 Catalog Solution: (有任何问题欢迎留言或私聊 && 欢迎交流讨论哦 Catalog Problem:Portal传送门 原题目描述在最下面. 给定一个素数p ...
- HDU6440 Dream(费马小定理+构造) -2018CCPC网络赛1003
题意: 给定素数p,定义p内封闭的加法和乘法,使得$(m+n)^p=m^p+n^p$ 思路: 由费马小定理,p是素数,$a^{p-1}\equiv 1(mod\;p)$ 所以$(m+n)^{p}\eq ...
- HDU 5875 Function -2016 ICPC 大连赛区网络赛
题目链接 网络赛的水实在太深,这场居然没出线zzz,差了一点点,看到这道题的的时候就剩半个小时了.上面是官方的题意题解,打完了才知道暴力就可以过,暴力我们当时是想出来了的,如果稍稍再优化一下估计就过了 ...
- 大连网络赛 1006 Football Games
//大连网络赛 1006 // 吐槽:数据比较水.下面代码可以AC // 但是正解好像是:排序后,前i项的和大于等于i*(i-1) #include <bits/stdc++.h> usi ...
- 树形DP CCPC网络赛 HDU5834 Magic boy Bi Luo with his excited tree
// 树形DP CCPC网络赛 HDU5834 Magic boy Bi Luo with his excited tree // 题意:n个点的树,每个节点有权值为正,只能用一次,每条边有负权,可以 ...
随机推荐
- C++ vector容器类型的用法及注意
转自http://www.cnblogs.com/charley_yang/archive/2010/12/11/1903040.html vector类为内置数组提供了一种替代表示,与string类 ...
- IIS7.5配置自动添加www 及 限制通过IP访问web
IIS7.5配置自动添加www 方法 新建一个站点2(主机名为不带www的站点),将其重定向至带www的URL即可. 注意以下几点 站点2不可与站点1的路径一致,否则会导致站点1也会添加同样的重定向, ...
- 【BZOJ2120】数颜色(带修莫队)
点此看题面 大致题意:告诉你\(n\)只蜡笔的颜色,有两种操作:第一种操作将第\(x\)只蜡笔颜色改成\(y\),第二种操作询问区间\([l,r]\)内有多少种颜色的蜡笔. 考虑普通莫队 这题目第一眼 ...
- javaweb基础(25)_jsp标签实例一
一.简单标签(SimpleTag) 由于传统标签使用三个标签接口来完成不同的功能,显得过于繁琐,不利于标签技术的推广, SUN公司为降低标签技术的学习难度,在JSP 2.0中定义了一个更为简单.便于编 ...
- java连接MySQL数据库操作步骤
package com.swift; //这里导入的包是java.sql.Connection而不是com.mysql.jdbc.Connection import java.sql.Connecti ...
- mysql基础,事物
- Cluster - 基本概念
1.1 什么是集群 简单的说,集群(cluster)就是一组计算机,它们作为一个整体向用户提供一组网络资源.这些单个的计算机系统就是集群的节点(node).一个理想的集群是,用户从来不会意识到集群系统 ...
- nginx平滑升级的过程
1.开始之前首先查看当前的使用版本以及编译时的参数: [root@www ~]# /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.12.2 ...
- Javascript 模块化指北
前言 随着 Web 技术的蓬勃发展和依赖的基础设施日益完善,前端领域逐渐从浏览器扩展至服务端(Node.js),桌面端(PC.Android.iOS),乃至于物联网设备(IoT),其中 JavaScr ...
- linux 的安装
3linux 软件安装 3.1 vm ware 软件安装 双击VMware-workstation-full-10.0.2-1744117.1398244508.exe 单击下一步 单击下一步 选择典 ...