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 上传文件夹
前端代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...
- SSM增删改查
闲着无聊配置一遍SSM以及添加功能增删改查,如下图,其中坎坷也挺多!!! 1.工程如下图.(请忽略红叉,没有错误) 2.首先配置pom.xml文件. <project xmlns="h ...
- PCB载流你必须知道的那些事儿
也许大家都知道铜箔走线宽度与电流大小有关,往往都是硬件工程师让你走多少就走多少,但作为Layout工程师你还是要知道你的铜皮走线取值都由什么因素决定?取值多大才能让你安心? PCB的载流能力取决与以下 ...
- zabbix_agentd客户端安装与配置(windows操作系统)
zabbix_agentd客户端安装与配置(windows操作系统) ********** 客户端操作 ********** 标注:监控zabbix_agentd客户端安装对象是win s ...
- filp_open/filp_close/vfs_read/vfs_write
Linux系统成功的关键因素之一就是具有与其他操作系统和谐共存的能力.Linux系统的文件系统由两层结构构建:第一层是虚拟文件系统(VFS),第二层是各种不同的具体的文件系统. VFS就是把各种具体的 ...
- angular2 图片赋值的时候前面自动加 unsafe:xxx 导致图片信息不显示问题
需要创建一个pipe 代码如下 import { Pipe, PipeTransform } from '@angular/core'; import {DomSanitizer} from '@an ...
- js 实现控制点击事件在特定的毫秒内 只允许点击一次(防止重复点击)
代码 第一种方法 var forbidRepeartClick = (function(){ var instance = null; var canClick = true; function Bu ...
- 2018-2019-2 《网络对抗技术》Exp0 Kali安装 Week1
- 2018-2019-2 <网络对抗技术>Exp0 Kali安装 Week1 - 安装过程 - 安装Kali VMware上学期已经装好了,Kali的镜像文件是从同学那拷过来的,所以这两 ...
- itextsharp html转成pdf 特殊符号异常处理
项目中使用html转成pdf ,遇到包含& 特殊字符就会出错. 比如:<p>&</p>使用该html输出成pdf就会报异常 解决方案:需使用html转义符< ...
- 公司外网测试服务器 redis 被攻击复盘
最近 公司外网的测试的 redis 服务器被攻击,最开始是用 docker 搭建的 直接裸奔在外网,任何域名都可以通过 ip+6379来访问,最开始想的是测试服务器也没有啥,后面直接就被人登陆进去改了 ...