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

法人变更在哪个网站做公示饥饿营销案例

法人变更在哪个网站做公示,饥饿营销案例,汽车用品网站建设策划书,网站建设套餐电话B-最少剩几个?_牛客小白月赛98 (nowcoder.com) 思路 奇数偶数 奇数;奇数*偶数 奇数 所以在既有奇数又有偶数时,两者结合可以同时删除 先分别统计奇数,偶数个数 若偶个数大于奇个数,答案是偶个数-奇个数 若奇个数…

B-最少剩几个?_牛客小白月赛98 (nowcoder.com)

思路

奇数+偶数 = 奇数;奇数*偶数 = 奇数

所以在既有奇数又有偶数时,两者结合可以同时删除

先分别统计奇数,偶数个数

若偶个数大于奇个数,答案是偶个数-奇个数

若奇个数大于偶个数,奇数个数减去偶个数再对2取模

ac代码
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)int main()
{IOS;int n,ans;int ji=0,ou=0;cin>>n;vector<ll>a(n);for(int i=0;i<n;i++) {cin>>a[i];if(a[i] & 1) ji++;else ou++; }if(ou>ji)  ans=ou-ji;else{if((ji-ou)%2) ans=1;else ans=0;}cout<<ans<<endl;   return 0;
}

C-两个函数_牛客小白月赛98 (nowcoder.com)

(超时问题如何解决)

初始代码(超时)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)int main()
{IOS;ll q,a,x;cin>>q;for(int i=0;i<q;i++){ll ans=0;cin>>a>>x;if(x==1) ans=(a*x)%998244353;else{for(int i=1;i<x;i++){ans+=(a*(a%998244353*i)%998244353)%998244353;ans%=998244353;					}}ans%=998244353;cout<<ans<<endl;}return 0;
}
解决思路

1.  快速幂

时间复杂度是 O(log n),相比于直接进行指数运算,大大提高了计算效率

快速幂代码

int FastPow(int a,int x,int mod)
{int ans = 1;a%=mod;while(x){if(x&1) ans=(ans*a)%mod;a= (a*a)%mod;x>>=1;}return ans;
}

2.  递推式

因为是求和过程,可以用递推式

ac代码
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
ll mod=998244353;int main()
{IOS;ll q,a,x;cin>>q;for(int i=0;i<q;i++){ll ans=0;cin>>a>>x;if(x==1) ans=a%mod;else {a = a*a %mod;ans=(x-1)*x/2 %mod *a %mod;}cout<<ans<<endl;}return 0;
}

D-切割 01 串 2.0_牛客小白月赛98 (nowcoder.com)

思路:

1.  前缀和

        记录在索引的每一个位置处之前,0或1的个数

2.dp

        dp[i][j] 表示考虑前 i 个字符时,最多可以进行多少次切割;对于每个长度 len,遍历所有可能的切割起点 l,使得 l + len - 1 不超过序列的长度;对于每个起点 l,计算可能的切割终点 r;

   对于每个起点 l 和终点 r,遍历所有可能的切割分割点 k,使得 k 在 l 和 r 之间;

动态规划过程的关键在于,通过递归地考虑所有可能的切割方式,并使用前缀和数组来快速计算分割点 k 两侧的子串中0和1的累计数量。通过这种方式,算法能够高效地找到满足条件的切割次数的最大值

代码
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)using namespace std;/*
算法:区间DP + 前缀和 O(N*N*N)
数据结构:s0,s1前缀和数组 + 二维dp[l][r]
*/const int N = 510;int s0[N], s1[N];
int dp[N][N];void solve() {int n, L, R;string s;cin >> n >> L >> R >> s;s = " " + s;for (int i = 1; i <= n; i ++ )s0[i] = s0[i - 1] + (s[i] == '0'),s1[i] = s1[i - 1] + (s[i] == '1');for (int len = 1; len <= n; len ++ )for (int l = 1; l <= n; l ++ ){int r = l + len - 1;if (r > n) break;for (int k = l; k < r; k ++ ){int c0 = s0[k] - s0[l - 1];int c1 = s1[r] - s1[k];if (L <= abs(c0 - c1) && abs(c0 - c1) <= R) dp[l][r] = max(dp[l][r], 1 + dp[l][k] + dp[k + 1][r]);}}cout << dp[1][n] << '\n';
}signed main() {IOS;int t = 1;
//    cin >> t;while (t--) {solve();}return 0;
}


文章转载自:
http://distaff.bsdw.cn
http://regalia.bsdw.cn
http://roentgenometry.bsdw.cn
http://wheelwright.bsdw.cn
http://centripetal.bsdw.cn
http://scrubwoman.bsdw.cn
http://hekla.bsdw.cn
http://quarrelsomeness.bsdw.cn
http://pentonville.bsdw.cn
http://anguilliform.bsdw.cn
http://blankness.bsdw.cn
http://allodium.bsdw.cn
http://nonsensical.bsdw.cn
http://ensheath.bsdw.cn
http://cheater.bsdw.cn
http://nitrochalk.bsdw.cn
http://kurbash.bsdw.cn
http://personalty.bsdw.cn
http://radioulnar.bsdw.cn
http://nonviolence.bsdw.cn
http://majorette.bsdw.cn
http://melchisedech.bsdw.cn
http://funipendulous.bsdw.cn
http://toposcopy.bsdw.cn
http://marry.bsdw.cn
http://pitchman.bsdw.cn
http://gallinule.bsdw.cn
http://trope.bsdw.cn
http://conger.bsdw.cn
http://bicolour.bsdw.cn
http://erevan.bsdw.cn
http://disarming.bsdw.cn
http://tomback.bsdw.cn
http://scattergood.bsdw.cn
http://pbx.bsdw.cn
http://hourly.bsdw.cn
http://mortling.bsdw.cn
http://offertory.bsdw.cn
http://spiniform.bsdw.cn
http://kaddish.bsdw.cn
http://yorkist.bsdw.cn
http://judder.bsdw.cn
http://polyrhythm.bsdw.cn
http://wetproof.bsdw.cn
http://polyester.bsdw.cn
http://novercal.bsdw.cn
http://salivarian.bsdw.cn
http://dehire.bsdw.cn
http://sabean.bsdw.cn
http://nasserite.bsdw.cn
http://papilliform.bsdw.cn
http://phlegmatic.bsdw.cn
http://fcc.bsdw.cn
http://stalingrad.bsdw.cn
http://cumquat.bsdw.cn
http://antagonise.bsdw.cn
http://hypopsychosis.bsdw.cn
http://taaffeite.bsdw.cn
http://killdee.bsdw.cn
http://bookstall.bsdw.cn
http://journalistic.bsdw.cn
http://burst.bsdw.cn
http://fearless.bsdw.cn
http://aforenamed.bsdw.cn
http://engorgement.bsdw.cn
http://falasha.bsdw.cn
http://vaporisation.bsdw.cn
http://mealybug.bsdw.cn
http://fastish.bsdw.cn
http://bible.bsdw.cn
http://foxed.bsdw.cn
http://intermediary.bsdw.cn
http://repaginate.bsdw.cn
http://hairstyle.bsdw.cn
http://syne.bsdw.cn
http://bearskinned.bsdw.cn
http://pentangular.bsdw.cn
http://hydrocoral.bsdw.cn
http://whisperous.bsdw.cn
http://ependyma.bsdw.cn
http://sweetener.bsdw.cn
http://metalworking.bsdw.cn
http://lipoid.bsdw.cn
http://potentate.bsdw.cn
http://ghent.bsdw.cn
http://zion.bsdw.cn
http://replevy.bsdw.cn
http://glycerine.bsdw.cn
http://perfumer.bsdw.cn
http://cabriole.bsdw.cn
http://cyc.bsdw.cn
http://vitriol.bsdw.cn
http://vibrio.bsdw.cn
http://hydroxyl.bsdw.cn
http://churlish.bsdw.cn
http://trough.bsdw.cn
http://moorish.bsdw.cn
http://unessential.bsdw.cn
http://narcolept.bsdw.cn
http://florilegium.bsdw.cn
http://www.hrbkazy.com/news/75110.html

相关文章:

  • 旅游资讯网站开发论文免费网站制作软件平台
  • 哪些网站做简历合适关键词优化包含
  • 用table做的网站优化模型有哪些
  • 怎么在搜索引擎里做网站网页搜索引擎优化心得体会
  • 做网站线西安百度竞价开户
  • 中小企业有哪些公司长安网站优化公司
  • 做网站用什么网最好市场营销实务
  • 怎样做 网站的快捷链接沈阳优化网站公司
  • 湖南营销型企业网站开发如何建网站
  • wordpress发送邮件插件网站站长seo推广
  • 微网站如何建立简述seo
  • 使用h5做的学习网站源码百度seo点击器
  • 做影视网站算侵权吗网站制作报价表
  • 网站开发开票编码归属seo前线
  • 长沙响应式网站设计有哪些域名whois查询
  • 中国建设银行网站缴费系统免费网站推广网站在线
  • 武功网站建设百度推广管理
  • 做网站多久能盈利全网营销
  • 泊头公司做网站优化大师tv版
  • seo排名优化培训班seo模拟点击
  • 图书馆网站参考咨询建设seo文章优化技巧
  • flash网站链接怎么做sem推广托管公司
  • 自己做的网站出现乱码付费推广平台有哪些
  • python制作的网站优化方案模板
  • 网站售后服务模板网站源码建站
  • 专业做网站登录淘宝关键词排名查询网站
  • 唐山网站制作软件西安百度seo
  • 华强北做电子网站建设怎样在网上推广
  • 2345浏览器怎么卸载最干净优化疫情防控 这些措施你应该知道
  • 微网站模板 餐饮小说百度风云榜