Codeforces Round #265 (Div. 2)_html/css_WEB-ITnose
Jun 24, 2016 am 11:58 AM
round
Codeforces Round #265 (Div. 2)
题目链接
A:把数字变换后比较一下几个不一样即可
B:连续2个以上0当作一次操作,开头的0和结尾的0可以忽略
C:贪心从末尾去构造,由于保证一开始是回文,所以保证修改后出现回文只可能为长度2或3的,这样的话判断复杂度就很小了
D:暴力枚举情况,然后判断
E:把操作逆过来处理出每个数字对应的位数和相应数字,然后在for一遍计算答案即可
代码:
A:
#include <cstdio>#include <cstring>int n, num[105], sb[105];char s[105];int main() { scanf("%d", &n); scanf("%s", s); for (int i = 0; i <br> B: <p></p> <p> </p> <pre name="code" class="sycode">#include <cstdio>#include <cstring>const int N = 1005;int n, num[N];int solve() { int ans = 0; int s = 0, e = n - 1; while (num[s] == 0 && s = 0) e--; for (int i = s ; i <br> C: <p></p> <p> </p> <pre name="code" class="sycode">#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int N = 1005;int n, p;char str[N];bool solve(int u) { if (u = 0 && str[u] == str[u - 1]) return solve(u); if (u - 2 >= 0 && str[u] == str[u - 2]) return solve(u); return true; }}int main() { scanf("%d%d", &n, &p); scanf("%s", str); if (solve(n - 1)) printf("%s\n", str); else printf("NO\n"); return 0;}</algorithm></cstring></cstdio>
登录后复制
D:
#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>#include <iostream>#include <set>using namespace std;struct Point { int v[3]; void read() { for (int i = 0; i <br> E: <p></p> <p> </p> <pre name="code" class="sycode">#include <cstdio>#include <cstring>#include <cmath>#include <vector>using namespace std;typedef long long ll;const ll MOD = 1000000007;const int N = 100005;char str[N], sss[N];int n;ll pow_mod(ll x, ll k) { ll ans = 1; while (k) { if (k&1) ans = (ans * x) % MOD; x = x * x % MOD; k >>= 1; } return ans;}ll v[15], l[15];ll idx(char c) { return c - '0';}struct State { ll u; vector<ll> v; void init(char *str) { int len = strlen(str); u = idx(str[0]); v.clear(); for (int i = 3; i = 0; i--) { ll lt = 0, vt = 0; for (int j = 0; j <br> <br> <p></p> </ll></vector></cmath></cstring></cstdio>
登录后复制
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门文章
仓库:如何复兴队友
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 周前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
击败分裂小说需要多长时间?
3 周前
By DDD
公众号网页更新缓存难题:如何避免版本更新后旧缓存影响用户体验?
3 周前
By 王林

热门文章
仓库:如何复兴队友
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 周前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
击败分裂小说需要多长时间?
3 周前
By DDD
公众号网页更新缓存难题:如何避免版本更新后旧缓存影响用户体验?
3 周前
By 王林

热门文章标签

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

&lt; iframe&gt;的目的是什么。 标签?使用时的安全考虑是什么?
