Codeforces Round #555 (Div. 3) AB
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的更多相关文章
- Codeforces Round #713 (Div. 3)AB题
Codeforces Round #713 (Div. 3) Editorial 记录一下自己写的前二题本人比较菜 A. Spy Detected! You are given an array a ...
- Codeforces Round #260 (Div. 2)AB
http://codeforces.com/contest/456/problem/A A. Laptops time limit per test 1 second memory limit per ...
- Codeforces Round #259 (Div. 2)AB
链接:http://codeforces.com/contest/454/problem/A A. Little Pony and Crystal Mine time limit per test 1 ...
- 老年OIer的Python实践记—— Codeforces Round #555 (Div. 3) solution
对没错下面的代码全部是python 3(除了E的那个multiset) 题目链接:https://codeforces.com/contest/1157 A. Reachable Numbers 按位 ...
- CodeForces Round #555 Div.3
A. Reachable Numbers 代码: #include <bits/stdc++.h> using namespace std; ; int N; set<int> ...
- 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] ...
- Codeforces Round #555 (Div. 3)[1157]题解
不得不说这场div3是真的出的好,算得上是从我开始打开始最有趣的一场div3.因为自己的号全都蓝了,然后就把不经常打比赛的dreagonm的号借来打这场,然后...比赛结束rank11(帮dreago ...
- Codeforces Round #555 (Div. 3) c2 d e f
c2:Increasing Subsequence (hard version) 那边小取那边,然后相等比较后面的长度 #include<bits/stdc++.h> using name ...
- Codeforces Round #555 (Div. 3) D. N Problems During K Days 【数学思维】
一 题面 D. N Problems During K Days 二 分析 对于这题,刚开始我就是陷入了对公式的执着,企图用公式直接确定第一个数,然后试着去找序列.经过思考和手动模拟后发现是很难保证正 ...
随机推荐
- springboot整合springdata-jpa
1.简介 SpringData : Spring 的一个子项目.用于简化数据库访问,支持NoSQL 和 关系数据存储.其主要目标是使数据库的访问变得方便快捷. SpringData 项目所支持 No ...
- @Html.LabelFor 如何直接添加CSS样式
样式用的是bootstrap. 我想单独调整一下其中一个控件的样式,大概这个造型. @Html.LabelFor(m => m.DerivationRate, new { @class = &q ...
- vue的过滤器filter
前记: 排版记录,未免太耽误时间,我就简单的来,下面是一个vue 过滤器的写法,demo 演示,限制一个字符串的长度. vue filter 的官网介绍 https://cn.vuejs.org/v2 ...
- Light OJ 1343 - Aladdin and the Black Stones
题目 link 求偶数子序列 满足 的个数. 分析 首先, 我们先把每一对a[i] + a[j]存起来, 这样就可以把题目的偶数个条件无视了. 设 T[i,j] = a[i] + a[j]; 因为我们 ...
- 项目debug启动不起来解决办法
debug起服务,读取文件可能会出错,eclipse自动加断点,这时候就卡住了,这时候eclipse——window——show view breakpoints-——remove all,重新启动t ...
- jmeter获取请求信息和响应信息
String tmp = prev.getUrlAsString(); String tmp = prev.getRequestHeaders(); String tmp = prev.getResp ...
- itextsharp html转成pdf 特殊符号异常处理
项目中使用html转成pdf ,遇到包含& 特殊字符就会出错. 比如:<p>&</p>使用该html输出成pdf就会报异常 解决方案:需使用html转义符< ...
- pyqt5与QML开发小结
遇见的坑 qt 5.11 与 qt 5.12 中Qquick的差异还是蛮大的,由开发环境:Pyqt5.11 + Qt5.12 部署到 Pyqt5.11 + Qt5.11时遇到以下问题: 1.当一个It ...
- 认识uWSGI、uwsgi、wsgi
WSGI协议 首先弄清下面几个概念: WSGI:全称是Web Server Gateway Interface,WSGI不是服务器,python模块,框架,API或者任何软件,只是一种规范,描述web ...
- shiro登录密码加密
密码加密 String passwd = new SimpleHash("SHA-1", "username", "password").t ...