Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)A B题
当时晚上打CF时候比较晚,加上是集训期间的室友都没有晚上刷题的习惯,感觉这场CF很不在状态.A题写复杂WA了一发后去厕所洗了个脸冷静了下,换个简单写法,可是用cin加了ios::sync_with_stdio(false)还是WA了,真无语.B题读半天题,读懂后轻松A了,看了下比赛时间就快结束了,把C题读了一遍后,感觉能做,最后还是选择了睡觉23333..................
A题大意:
平平平 增平减 ,缺任一都可,判断是否为这样的数列

#include<stdio.h>
#include<cmath>
#include<string.h>
#include<iostream>
#include<algorithm>
#define INF 0x3f3f3f3f
using namespace std;
#define maxn 1005
#define inf 0x3f3f3f3f
int main()
{
int n,a[maxn];
while(~scanf("%d",&n))
{
for(int i=1;i<=n;i++) scanf("%d",&a[i]);
a[n+1]=inf;
int p=2;
while(a[p]>a[p-1]) p++;
while(a[p]==a[p-1]) p++;
while(a[p]<a[p-1]) p++;
if(p>n) printf("YES\n");
else printf("NO\n");
}
return 0;
}
B题大意:
就是题目意思不好理解而已QAQ
给出三个字符串,其中第一和第二字符串长度都为26,在第三个字符串每个字符
若在第一个字符串找到相同的英文字母,则将第二个字符串中对应的英文字母打
印(注意大小写即可),若无对应,则将直接打印TwT

#include<stdio.h>
#include<cmath>
#include<cstring>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#define INF 0x3f3f3f3f
using namespace std;
#define maxn 1005
char a[maxn],b[maxn],c[maxn];
int main()
{
while(~scanf("%s%s%s",a,b,c))
{
int len1=strlen(a),len2=strlen(c),p;
for(int i=0;i<len2;i++)
{
if(c[i]>='a'&&c[i]<='z')
{
for(int j=0;j<len1;j++)
if(a[j]==c[i]) {p=j;break;}
printf("%c",b[p]);
}
else if(c[i]>='A'&&c[i]<='Z')
{
for(int j=0;j<len1;j++)
if(a[j]==c[i]+32) {p=j;break;}
printf("%c",b[p]-32);
}
else printf("%c",c[i]);
}
printf("\n");
}
return 0;
}
Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)A B题的更多相关文章
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)
http://codeforces.com/contest/831 A. Unimodal Array time limit per test 1 second memory limit per te ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem C (Codeforces 831C) - 暴力 - 二分法
Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)A,B,C
A:链接:http://codeforces.com/contest/831/problem/A 解题思路: 从前往后分别统计递增,相等,递减序列的长度,如果最后长度和原序列长度相等那么就输出yes: ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem F (Codeforces 831F) - 数论 - 暴力
题目传送门 传送门I 传送门II 传送门III 题目大意 求一个满足$d\sum_{i = 1}^{n} \left \lceil \frac{a_i}{d} \right \rceil - \sum ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem D (Codeforces 831D) - 贪心 - 二分答案 - 动态规划
There are n people and k keys on a straight line. Every person wants to get to the office which is l ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem E (Codeforces 831E) - 线段树 - 树状数组
Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this int ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem A - B
Array of integers is unimodal, if: it is strictly increasing in the beginning; after that it is cons ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) A 水 B stl C stl D 暴力 E 树状数组
A. Unimodal Array time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) - D
题目链接:http://codeforces.com/contest/831/problem/D 题意:在一个一维坐标里,有n个人,k把钥匙(钥匙出现的位置不会重复并且对应位置只有一把钥匙),和一个终 ...
随机推荐
- springboot 1.5.2 thymeleaf 添加templates 静态资源访问路径
从velocity 模板切换到thymeleaf 后, 默认模板位置为templates , 有时候静态资源方在该目录下会出现访问404错误 解决办法: application.properties ...
- Git基础-打标签
打标签 同大多数 VCS 一样,Git 也可以对某一时间点上的版本打上标签.人们在发布某个软件版本(比如 v1.0 等等)的时候,经常这么做.本节我们一起来学习如何列出所有可用的标签,如何新建标签,以 ...
- CentOS 虚拟机安装详解
第一步:安装 VMware 官方网站:www.vmware.com 下载百度云链接:http://pan.baidu.com/s/1bphDOWv 密码:0zix VMware 是一个虚拟 PC 的软 ...
- 阿里云 Centos7.3安装mysql5.7.18 rpm安装
卸载MariaDB CentOS7默认安装MariaDB而不是MySQL,而且yum服务器上也移除了MySQL相关的软件包.因为MariaDB和MySQL可能会冲突,故先卸载MariaDB. 1.安装 ...
- 每天一个JS 小demo之“随机”抽奖。主要知识点:Math函数,数组方法,递归
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"& ...
- Ajax请求(二)--JQuery的Ajax请求方法
JQuery库的Ajax请求的几种方法: 1. load( url, [data], [callback] ) :载入远程 HTML 文件代码并插入至 DOM 中. 参数含义: url (String ...
- 微软SQL Server认证最新信息(17年5月22日更新),感兴趣的进来看看哟
之前一直有在关注微软认证的一些消息,由于最新的SQL Server认证加入了2016的相关内容,导致课程资料需要大部分更新,但是微软更新相对比较慢,并且经常改版,目前发现的最新的MCP Cert Pa ...
- 浅谈java内存分配和回收策略
一.导论 java技术体系中所提到的内存自动化管理归根结底就是内存的分配与回收两个问题,之前已经和大家谈过java回收的相关知识,今天来和大家聊聊java对象的在内存中的分配.通俗的讲,对象的内存分配 ...
- HashMap如何工作 - Java
大多数人应该会同意HashMap是现在面试最喜欢问的主题之一.我和同事常常进行讨论,并很有帮助.现在,我继续和大家讨论. 我假设你对HashMap的内部工作原理感兴趣,并且你已经知道了基本的HashM ...
- [USACO08JAN]手机网络Cell Phone Network
[USACO08JAN]手机网络Cell Phone Network 题目描述 Farmer John has decided to give each of his cows a cell phon ...