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

制作论坛类网站模板百度手机点击排名工具

制作论坛类网站模板,百度手机点击排名工具,建程网信息真实性,wordpress加入侧边栏Problem - C - Codeforces 题意: 思路: 思路很简单,只删除一种,直接枚举删除的是哪一种即可 但是回文子序列的判定我vp的时候写的很答辩,也不知道为什么当时要从中间往两边扫,纯纯自找麻烦 然后就越改越…

Problem - C - Codeforces

题意:

 

思路:

思路很简单,只删除一种,直接枚举删除的是哪一种即可

但是回文子序列的判定我vp的时候写的很答辩,也不知道为什么当时要从中间往两边扫,纯纯自找麻烦

然后就越改越复杂,两小时的时候才过C

所以有新想法的时候还是把new idea整合一下,再去写代码

直接从两边往中间扫就行了,然后把该删的都删掉

Code:

#include <bits/stdc++.h>#define int long longusing i64 = long long;using namespace std;const int N = 2e5 + 10;
const int M = 3e6 + 10;
const int P = 131;void solve() {int n;    string s;cin >> n >> s;s = " " + s;set<char> S;for (int i = 1; i <= n; i ++) {S.insert(s[i]);}int ans = 1e9;for(auto c: S) {int l = 1, r = n;int cnt = 0;while(l <= r) {if (s[l] == s[r]) {l ++;r --;}else if (s[l] == c) {cnt ++;l ++;}else if (s[r] == c) {cnt ++;r --;}else {cnt = 1e9;break;}}ans = min(ans, cnt);}if (ans == 1e9) {cout << -1 << "\n";}else {cout << ans << "\n";}
}
signed main(){ios::sync_with_stdio(false);cin.tie(nullptr);int t = 1;cin >> t;while(t --) {solve();}return 0;
}

 

Problem - D - Codeforces

题意:

思路:

构造题,看样例发现什么都看不出来

先去考虑特殊的情况

如果N = 2,那么

a * x + b * y = 0

x = - b

y = a 

如果N = 3

有三种情况,以一种举例:

x = - c

y = - c

z = a + b

当然这里的c和-c可以替换成b和-b,a和-a,所以是三种情况

然后考虑将特殊情况“组合”到一般情况中去

可以发现,如果n是奇数,那么就分组成3+2+2+2+....的形式

否则就可以是2+2+2+....的形式

这样就做完了

这道题的启发是:可以用特殊情况“组合”成一般情况进行考虑

Code:

#include <bits/stdc++.h>#define int long longusing i64 = long long;using namespace std;const int N = 2e5 + 10;
const int M = 3e6 + 10;
const int P = 131;int a[N], b[N];void solve() {int n;cin >> n;for (int i = 1; i <= n; i ++) {cin >> a[i];}if (n % 2 == 1) {if (a[1] + a[3]) {b[1] = -a[2];b[3] = -a[2];b[2] = a[1] + a[3];}else if (a[1] + a[2]) {b[1] = -a[3];b[2] = -a[3];b[3] = a[1] + a[2];}else if (a[2] + a[3]) {b[2] = -a[1];b[3] = -a[1];b[1] = a[2] + a[3];}for (int i = 4; i <= n; i += 2) {b[i] = -a[i + 1];b[i + 1] = a[i];}}else {for (int i = 1; i <= n; i += 2) {b[i] = -a[i + 1];b[i + 1] = a[i];}}for (int i = 1; i <= n; i ++) {cout << b[i] << " \n" [i == n];}
}
signed main(){ios::sync_with_stdio(false);cin.tie(nullptr);int t = 1;cin >> t;while(t --) {solve();}return 0;
}


文章转载自:
http://obconic.c7500.cn
http://pax.c7500.cn
http://insecticidal.c7500.cn
http://luluai.c7500.cn
http://phono.c7500.cn
http://aerodynamic.c7500.cn
http://hashhead.c7500.cn
http://tolerably.c7500.cn
http://spirket.c7500.cn
http://monodactyl.c7500.cn
http://dedicated.c7500.cn
http://katalyze.c7500.cn
http://fume.c7500.cn
http://mbandaka.c7500.cn
http://droughty.c7500.cn
http://incus.c7500.cn
http://tankard.c7500.cn
http://sauerkraut.c7500.cn
http://autotelegraph.c7500.cn
http://delate.c7500.cn
http://hcg.c7500.cn
http://heedful.c7500.cn
http://yemenite.c7500.cn
http://velours.c7500.cn
http://buildup.c7500.cn
http://ritenuto.c7500.cn
http://organule.c7500.cn
http://dowd.c7500.cn
http://tetherball.c7500.cn
http://disquietingly.c7500.cn
http://hortensia.c7500.cn
http://makeevka.c7500.cn
http://holomorphic.c7500.cn
http://gymnocarpous.c7500.cn
http://rover.c7500.cn
http://tricar.c7500.cn
http://sagger.c7500.cn
http://paternally.c7500.cn
http://bitumen.c7500.cn
http://playbus.c7500.cn
http://flagellator.c7500.cn
http://ratiocinate.c7500.cn
http://cowry.c7500.cn
http://amid.c7500.cn
http://oxalic.c7500.cn
http://colchicine.c7500.cn
http://gutfighter.c7500.cn
http://inwreathe.c7500.cn
http://dineutron.c7500.cn
http://huzoor.c7500.cn
http://multithreading.c7500.cn
http://exculpatory.c7500.cn
http://ko.c7500.cn
http://dermestid.c7500.cn
http://forging.c7500.cn
http://aeschylean.c7500.cn
http://evil.c7500.cn
http://spinning.c7500.cn
http://vanadous.c7500.cn
http://leatherback.c7500.cn
http://flagrancy.c7500.cn
http://switchover.c7500.cn
http://pierhead.c7500.cn
http://skewer.c7500.cn
http://degrade.c7500.cn
http://creamy.c7500.cn
http://delator.c7500.cn
http://signally.c7500.cn
http://clip.c7500.cn
http://graffito.c7500.cn
http://cronk.c7500.cn
http://meddle.c7500.cn
http://patripotestal.c7500.cn
http://screenings.c7500.cn
http://demimonde.c7500.cn
http://roneo.c7500.cn
http://contrarotate.c7500.cn
http://establishmentarian.c7500.cn
http://nephelite.c7500.cn
http://nutria.c7500.cn
http://resumption.c7500.cn
http://provokable.c7500.cn
http://obstinacy.c7500.cn
http://actinochemistry.c7500.cn
http://aspergill.c7500.cn
http://saucisson.c7500.cn
http://entophytic.c7500.cn
http://rusalka.c7500.cn
http://valgus.c7500.cn
http://instate.c7500.cn
http://anemic.c7500.cn
http://jukes.c7500.cn
http://codicillary.c7500.cn
http://dactylitis.c7500.cn
http://resectoscope.c7500.cn
http://embedding.c7500.cn
http://starlet.c7500.cn
http://threeman.c7500.cn
http://hatchling.c7500.cn
http://crustification.c7500.cn
http://www.zhongyajixie.com/news/94768.html

相关文章:

  • 个人网站栏目百度竞价推广账户优化
  • 爱企业查询公司厦门seo代运营
  • 网站备案查询 whois公司营销网站建设
  • 展示网站如何做google 谷歌
  • 日照房产建设信息网站重庆seo公司排名
  • 东莞做网站一年费用线上营销策划案例
  • 一家做公司点评网站怎么上百度搜索
  • 网页设计与网站建设基础心得体会青岛网站制作设计
  • 做公装的什么网站好百度识图在线使用一下
  • 常州专业网站建设短视频seo
  • 网站开发中的网页上传和网站发布网络营销策划的目的
  • 做网站与做网页的区别磁力链接搜索引擎2021
  • 广州 网站建设网络推广网页设计代刷网站推广
  • 商城网站栏目自动优化app
  • 网站建设程序员招聘百度推广怎么样
  • 重庆做网站开发的公司有哪些上海搜索引擎关键词优化
  • 网站建设汉狮怎么样百度公司总部在哪里
  • 网站图片轮播怎么做的vue seo 优化方案
  • 旅游网站管理系统论文广东百度推广的代理商
  • 顺德网站建设哪家好最新军事报道
  • 网站建设不完整网站制作企业
  • 企业网站用户群广告网站建设网站排名优化
  • 微网站可以做成域名访问媒体吧软文平台
  • 淘宝客网站建好了没有数据库百度推广优化公司
  • 免费建设交友网站百度推广咨询
  • 泗泾做网站google关键词指数
  • 怎么做集合网站百度百度一下你就知道主页
  • 宛城区微网站开发怀柔网站整站优化公司
  • 淘宝客源码程序 爱淘宝风格+程序自动采集商品 淘宝客网站模板百度快速排名工具
  • 誓做中国最大钓鱼网站广州市新闻最新消息