当时晚上打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题的更多相关文章

  1. 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 ...

  2. 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 ...

  3. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)A,B,C

    A:链接:http://codeforces.com/contest/831/problem/A 解题思路: 从前往后分别统计递增,相等,递减序列的长度,如果最后长度和原序列长度相等那么就输出yes: ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) - D

    题目链接:http://codeforces.com/contest/831/problem/D 题意:在一个一维坐标里,有n个人,k把钥匙(钥匙出现的位置不会重复并且对应位置只有一把钥匙),和一个终 ...

随机推荐

  1. R实现地理位置与经纬度相互转换

    本实例要实现目标通过输入城市名或者地名,然后找出其经度纬度值,以及通过可视化展现其线路流向以及周边地图展示 address_list数据: 山西省太原市小店区亲贤北街77号 贵州省贵阳市云岩区书香门第 ...

  2. (数字IC)低功耗设计入门(七)——门级电路低功耗设计优化(续)

    前面讲解了门级功耗的优化方法,包括静动态和总体的功耗.现在来记录一下门级层次(有点书也说是在系统级)常用的一种低功耗方法--电源门控. ①电源门控概述与原理 电源门控是指芯片中某个区域的供电电源被关掉 ...

  3. 【web前端开发】浏览器兼容性处理

    1.居中问题div里的内容,IE默认为居中,而FF默认为左对齐,可以尝试增加代码margin: 0 auto;2.高度问题两上下排列或嵌套的div,上面的div设置高度(height),如果div里的 ...

  4. centos nginx-1.10.3 安装

    wget http://nginx.org/download/nginx-1.13.1.tar.gz nginx 依赖 pcre 库,要先安装pcre,因为nginx 要在rewrite 要解析正则表 ...

  5. 分页简单的封装SSM+easyUi

    public class Page { private int page = 1; //初始页 private int rows = 10; //一页多少行数据 private String q;// ...

  6. Mybatis学习(二) - CRUD操作(增删改查操作)

    直接上例子: 1.项目结构: 2.具体代码及配置 User.java package com.mybatis.bean; public class User { private int id; pri ...

  7. 【论文:麦克风阵列增强】Signal Enhancement Using Beamforming and Nonstationarity with Applications to Speech

    作者:桂. 时间:2017-06-06 13:25:58 链接:http://www.cnblogs.com/xingshansi/p/6943833.html 论文原文:http://pan.bai ...

  8. 理解Java中的抽象

    在计算机科学中,抽象是一种过程,在这个过程中,数据和程序定义的形式与代表的内涵语言相似,同时隐藏了实现细节. 抽象:一个概念或者想法不和任何特定的具体实例绑死. 目录 什么是抽象 抽象的形式 如何在J ...

  9. Java NIO学习笔记 NIO选择器

    Java NIO选择器 A Selector是一个Java NIO组件,可以检查一个或多个NIO通道,并确定哪些通道已准备就绪,例如读取或写入.这样一个线程可以管理多个通道,从而管理多个网络连接. 为 ...

  10. django 调试 监控文件变化 自动刷新浏览器

    问题描述:修改html js py等文件后,自动刷新浏览器,解放F5,提高效率 解决办法:使用gulp,使用bowerSync 关于gulp,可以查看系列教程 关于bowerSync,查看官网 关于结 ...