A:    http://codeforces.com/contest/1157/problem/A

题意:每次加到10的整数倍之后,去掉后面的0,问最多有多少种可能。

 #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set> using namespace std; int main()
{
ios::sync_with_stdio(false);
cin.tie();
cout.tie(); int n;
set<int> si;
while(cin>>n){
si.clear();
si.insert(si.end(),n);
while(n!=){
n++;
while(n%==){
n/=;
}
si.insert(si.end(),n);
}
n=;
si.insert(si.end(),n);
while(n!=){
n++;
while(n%==){
n/=;
}
si.insert(si.end(),n);
}
cout<<si.size()<<endl;
}
return ;
}

B:   http://codeforces.com/contest/1157/problem/B

题意:有一个很长的字符串,和1-9之间数字的映射关系。问修改其中一段得到的最大的串是什么。(可以进行0次或1次修改)

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set> using namespace std; int main()
{
ios::sync_with_stdio(false);
cin.tie();
cout.tie(); int n;
string s1;
int mapp[];
while(cin>>n){
cin>>s1; string s3(s1);
for(int i=;i<;i++){
cin>>mapp[i];
}
for(int j=;j<s1.size();j++){
string s2(s1);
for(int i=j;i<s1.size();i++){
char t=mapp[s1[i]-'']+'';
if(t>=s1[i]){
s2[i]=mapp[s1[i]-'']+'';
}else{
break;
}
}
if(s2>s3) s3=s2;
}
cout<<s3<<endl;
}
return ;
}

Codeforces Round #555 (Div. 3) AB的更多相关文章

  1. Codeforces Round #713 (Div. 3)AB题

    Codeforces Round #713 (Div. 3) Editorial 记录一下自己写的前二题本人比较菜 A. Spy Detected! You are given an array a ...

  2. Codeforces Round #260 (Div. 2)AB

    http://codeforces.com/contest/456/problem/A A. Laptops time limit per test 1 second memory limit per ...

  3. Codeforces Round #259 (Div. 2)AB

    链接:http://codeforces.com/contest/454/problem/A A. Little Pony and Crystal Mine time limit per test 1 ...

  4. 老年OIer的Python实践记—— Codeforces Round #555 (Div. 3) solution

    对没错下面的代码全部是python 3(除了E的那个multiset) 题目链接:https://codeforces.com/contest/1157 A. Reachable Numbers 按位 ...

  5. CodeForces Round #555 Div.3

    A. Reachable Numbers 代码: #include <bits/stdc++.h> using namespace std; ; int N; set<int> ...

  6. Codeforces Round #555 (Div. 3) E. Minimum Array

    题意:b数组可以自由排序,c[i]=(a[i]+b[i])%n. 题目中要求c数组的字典序是最小的.那么我们需要尽量满足前面的c[i],才能使字典序最小. 我们知道a[i]和b[i]都是[0,n-1] ...

  7. Codeforces Round #555 (Div. 3)[1157]题解

    不得不说这场div3是真的出的好,算得上是从我开始打开始最有趣的一场div3.因为自己的号全都蓝了,然后就把不经常打比赛的dreagonm的号借来打这场,然后...比赛结束rank11(帮dreago ...

  8. Codeforces Round #555 (Div. 3) c2 d e f

    c2:Increasing Subsequence (hard version) 那边小取那边,然后相等比较后面的长度 #include<bits/stdc++.h> using name ...

  9. Codeforces Round #555 (Div. 3) D. N Problems During K Days 【数学思维】

    一 题面 D. N Problems During K Days 二 分析 对于这题,刚开始我就是陷入了对公式的执着,企图用公式直接确定第一个数,然后试着去找序列.经过思考和手动模拟后发现是很难保证正 ...

随机推荐

  1. L2-004 这是二叉搜索树吗? (25 分) (树)

    链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805070971912192 题目: 一棵二叉搜索树可被递归地定义为 ...

  2. input 上报流程图

    input 上报流程图 http://blog.chinaunix.net/uid-28320320-id-3389196.html

  3. nb-iot简介【转】

    转自:http://www.elecfans.com/tags/nb-iot/ 标签 > nb-iot nb-iot 关注 118人关注 提供NB-IoT技术特点,NB-IoT模块/芯片,NB- ...

  4. mysql GTID

    之前一直通过binlog主从同步,现在发现GTID这种方式,记录一下,具体可参考网上教程.感觉配置使用更为简单方便,不知实际效果如何.

  5. ptmalloc内存分配释放

    出处 分配: 1)获取分配区的锁,为了防止多个线程同时访问同一个分配区,在进行分配之前需要取得分配区域的锁.线程先查看线程私有实例中是否已经存在一个分配区,如果存在尝试对该分配区加锁,如果加锁成功,使 ...

  6. 执行大SQL脚本方法

    当我们需要在SQLServer数据库里面执行一个大的文件时,会发现数据库根本无法打开该脚本文件,原因是因为查询分析器只能执行100M以内的文件,所以脚本过大就会造成内存溢出.此时我们可以使用osql工 ...

  7. PHP获取汉字首字母并分组排序

    <?php /** * 错误状态码定义 * User: xiucai * Date: 2018/3/11 * Time: 12:23 */ namespace extend; class Wor ...

  8. 【微信小程序canvas】实现小程序手写板用户签名(附代码)

    工作中公司业务需要的微信小程序用户签字功能 先看效果图: wxml: <view class="wrapper"> <view class="handB ...

  9. sql查找某一列中某一数值出现次数大于3的记录的前3条

    SELECT * FROM table  GROUP BY column HAVING COUNT(column)>=3 ORDER BY column DESC LIMIT 0,3;

  10. centos6.9 改系统语言成中文简体

    1.在root权限下 切换到root下:su root 查看当前语言环境:locale -a  (注意中间有空格) 如果看到 zh_CN.UTF-8(这个是中文简体)说明你的系统支持中文语言 2.编辑 ...