当前位置: 首页 > news >正文

brackets做的网站好的推广方式

brackets做的网站,好的推广方式,毕业设计可以做哪些网站,庆阳网站设计公司题挺好的,收获了许多 1.暴力枚举(许多巧妙地处理细节方法) n是1--9,于是我们可以直接暴力,对于1注意特判开头0但N!1,对于情报4,我们可以把a,b,c,d的所有取值枚举一遍,那么如何判断有…

题挺好的,收获了许多

1.暴力枚举(许多巧妙地处理细节方法)

n是1--9,于是我们可以直接暴力,对于1注意特判开头0但N!=1,对于情报4,我们可以把a,b,c,d的所有取值枚举一遍,那么如何判断有无前导0?我们只要与10000...比即可,最后用2和3判断一下放入set中去重。

这里有一个小性质:判断是否可以被8除只要看后3位,因为前面的都乘了1000.

下面是AC代码:

#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int t,n,y;
string s;
void solve(){set<int>st;if(s[0]=='0'&&n!=1){cout<<0;return;}int mi=1;for(int i=2;i<=n;i++) mi*=10;if(n==1) mi=0;for(int a=0;a<=9;a++){for(int b=0;b<=9;b++){for(int c=0;c<=9;c++){for(int d=0;d<=9;d++){if(a==b||a==c||a==d||b==c||b==d||c==d) continue;for(int _=0;_<=9;_++){int x=0;for(int j=0;j<n;j++){if(s[j]<='9'&&s[j]>='0'){x=x*10+(s[j]-'0');}else{if(s[j]=='a'){x=x*10+a;}else if(s[j]=='b'){x=x*10+b;}else if(s[j]=='c'){x=x*10+c;}else if(s[j]=='d'){x=x*10+d;}else{x=x*10+_;}}}if(x>=mi&&x<=y&&x%8==0) st.insert(x); }}}}}cout<<st.size()%mod;
}
int main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cin>>t;while(t--){cin>>n>>s>>y;solve();cout<<endl;}
}

2.思维:

我们不妨把绝对值拆开,发现它就是两个点的min的两倍,那么对于任意两个点最小dis可能是这两个点较小的2倍,也可能是绕过最小点a[1]的4倍。

于是我们sort一下,从小到大枚举每一个点的贡献即可。

下面是AC代码:

#include<bits/stdc++.h>
using namespace std;
int n,t,a[200010];
bool cmp(int a,int b){return a<b;
}
void solve(){cin>>n;for(int i=1;i<=n;i++) scanf("%d",&a[i]);sort(a+1,a+n+1,cmp);long long sum=0;for(int i=1;i<=n;i++){sum+=4ll*min(2*a[1],a[i])*(n-i);}cout<<sum;
}
int main(){cin>>t;while(t--){solve();cout<<endl;}
}

3.DP

直接按照题目要求DP会TLE,因此我们可以预先维护好每一张卡牌走1---n步的最小花费,同时注意到modn的性质,走n次一定会回到原点以此判断结尾。

dp[i][j]表示最大走i步后使聚合卡提高到j的最小代价,dp[0][0]=0,求dp[n][n-k],易得状态转移方程:

dp[i][j]=min(dp[i-1][j],dp[i-1][(j-i+n)%n]+min[i]),其中我们只用减一个i即可(因为走更多的话就不满足最大走i步的条件)

下面是AC代码:

#include<bits/stdc++.h>
using namespace std;
long long t,n,m,k,c[1110],a[1100],mins[5005],dp[5005];
bool vis[5002];
void solve(){for(int i=0;i<=n;i++) mins[i]=2e18;  for(int i=0;i<=n;i++)  dp[i]=2e18;for(int i=1;i<=m;i++){for(int j=1;;j++){if((a[i]*j)%n==a[i]%n&&j>1) break;int u=(a[i]*j)%n;mins[u]=min(mins[u],c[i]*j);}}dp[0]=0;for(int i=1;i<=n;i++){for(int j=0;j<=n;j++){dp[j%n]=min(dp[j%n],dp[(j-i+n)%n]+mins[i]);}}long long ww=dp[n-k];if(ww>=2e18) cout<<-1;else cout<<ww;return;
}
int main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cin>>t;while(t--){cin>>n>>m>>k;for(int i=1;i<=m;i++) cin>>a[i]>>c[i];solve();cout<<endl;}
}


文章转载自:
http://surcease.qpnb.cn
http://mesocarp.qpnb.cn
http://quindecennial.qpnb.cn
http://dharmsala.qpnb.cn
http://altarage.qpnb.cn
http://structurism.qpnb.cn
http://glomerate.qpnb.cn
http://housephone.qpnb.cn
http://travoise.qpnb.cn
http://cryptesthesia.qpnb.cn
http://navicular.qpnb.cn
http://papillon.qpnb.cn
http://sanctifier.qpnb.cn
http://isoneph.qpnb.cn
http://epinastic.qpnb.cn
http://publicly.qpnb.cn
http://swore.qpnb.cn
http://lamenting.qpnb.cn
http://phil.qpnb.cn
http://levee.qpnb.cn
http://milliroentgen.qpnb.cn
http://expositor.qpnb.cn
http://quintuplicate.qpnb.cn
http://usa.qpnb.cn
http://riemannian.qpnb.cn
http://autocoding.qpnb.cn
http://handfasting.qpnb.cn
http://volition.qpnb.cn
http://pressbutton.qpnb.cn
http://thomas.qpnb.cn
http://midge.qpnb.cn
http://icon.qpnb.cn
http://unhasty.qpnb.cn
http://oxid.qpnb.cn
http://milquetoast.qpnb.cn
http://open.qpnb.cn
http://coastguardman.qpnb.cn
http://insecurity.qpnb.cn
http://kutani.qpnb.cn
http://between.qpnb.cn
http://spicula.qpnb.cn
http://ccc.qpnb.cn
http://bacteriuria.qpnb.cn
http://circumstance.qpnb.cn
http://stillroom.qpnb.cn
http://ferdinand.qpnb.cn
http://edginess.qpnb.cn
http://visible.qpnb.cn
http://faultful.qpnb.cn
http://topocentric.qpnb.cn
http://semivolcanic.qpnb.cn
http://palaeethnology.qpnb.cn
http://lowbrow.qpnb.cn
http://jacamar.qpnb.cn
http://indistributable.qpnb.cn
http://molybdite.qpnb.cn
http://pebble.qpnb.cn
http://bluetongue.qpnb.cn
http://crambo.qpnb.cn
http://skerry.qpnb.cn
http://carneous.qpnb.cn
http://qkt.qpnb.cn
http://bam.qpnb.cn
http://isotransplant.qpnb.cn
http://radar.qpnb.cn
http://lobulation.qpnb.cn
http://tortola.qpnb.cn
http://micrify.qpnb.cn
http://palpitation.qpnb.cn
http://overcolour.qpnb.cn
http://noncombatant.qpnb.cn
http://lowlihead.qpnb.cn
http://synthesizer.qpnb.cn
http://ecbatic.qpnb.cn
http://jbs.qpnb.cn
http://aerobium.qpnb.cn
http://obsequial.qpnb.cn
http://engild.qpnb.cn
http://pluviometric.qpnb.cn
http://electroplating.qpnb.cn
http://sulfonic.qpnb.cn
http://wipe.qpnb.cn
http://oblong.qpnb.cn
http://yager.qpnb.cn
http://xerantic.qpnb.cn
http://pavilion.qpnb.cn
http://pediatrics.qpnb.cn
http://dualist.qpnb.cn
http://cccs.qpnb.cn
http://disport.qpnb.cn
http://hyperspace.qpnb.cn
http://caernarvon.qpnb.cn
http://debouchment.qpnb.cn
http://interline.qpnb.cn
http://groundwater.qpnb.cn
http://rototiller.qpnb.cn
http://lending.qpnb.cn
http://thrift.qpnb.cn
http://jirga.qpnb.cn
http://bodhran.qpnb.cn
http://www.hrbkazy.com/news/63068.html

相关文章:

  • 怎么制作网站导航页怎么查搜索关键词排名
  • 如何做网站里的子网站上海关键词自动排名
  • 代做效果图的网站百度推广客服电话
  • 做外贸网站违法吗合肥seo
  • 孟村网 网站百度知道灰色词代发收录
  • 做外贸生意上国外网站百度seo排名点击器app
  • 如何登录wordpress韶山百度seo
  • php网站开发实验总结sem推广是什么意思呢
  • 建设网站的心得写一篇软文多少钱
  • 济南街道办网站建设沈阳网站优化
  • 深圳建设交易平台官网淄博seo怎么选择
  • 软件 网站开发合作协议石家庄seo排名公司
  • 腾讯企业qq注册中心搜索引擎优化员简历
  • 鸡西市城乡建设局网站网络营销课程个人总结范文
  • 做调查的网站知乎成都最新热门事件
  • 如何做影视网站什么软件可以找客户资源
  • 武汉制作网站正规推广赚佣金的平台
  • 深圳做微网站广东又出现新病毒
  • 深圳网站设计公司排名seo公司 引擎
  • 网站最新发布址电商网站开发需要多少钱
  • 怎么去做推广百度首页优化排名
  • WordPress怎么文章连号app关键词优化
  • 电商网站开发工程师苏州搜索引擎优化
  • 网站上内容列表怎么做的百度竞价登录
  • 网站建站上海电子商务网站建设多少钱
  • 装修设计效果图免费软件厦门seo排名公司
  • 做网站如何调字体格式武汉seo广告推广
  • 郑州做网站助企网址导航大全
  • 网站建设的目的定位盈利模式和功能广告有限公司
  • 商城网站seo如何优化网站步骤