[ An Ac a Day ^_^ ] UVALive 7270 Osu! Master
2015icpc北京区域赛的签到题
还是很签到的 一次就过了
题意呢
就是统计B C后最长上升序列还有S的个数
当然B C要被S分割开……
/* ***********************************************
Author :Sun Yuefeng
Created Time :2016/10/16 18:41:24
File Name :A.cpp
************************************************ */ #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<bitset>
#include<map>
#include<set>
#include<stack>
#include<vector>
#include<queue>
#include<list>
#define M(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const int maxn=1e9+;
const int mod=1e7+;
int dx[]= {,,,-,,-,,-};
int dy[]= {,-,,,-,,,-}; int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int n;
while(~scanf("%d",&n)){
int ans=,last=-;
while(n--){
char a;
cin>>a;
if(a=='S'){
ans++;
last=-;
}
else{
int a;
scanf("%d",&a);
if(a>last){
if(last==-) ans++;
last=a;
}
else{
last=a;
ans++;
}
}
}
printf("%d\n",ans);
}
return ;
}
[ An Ac a Day ^_^ ] UVALive 7270 Osu! Master的更多相关文章
- UVALive 7270 Osu! Master (阅读理解题)
题目:传送门. 题意:阅读理解题,是一个osu的游戏,问得分.把题目翻译过来就是如果出现S或者BC后面跟的是1,ans就加1. #include <iostream> #include & ...
- UVaLive 7270 Osu! Master (统计)
题意:给定 n 个元素,有的有一个值,如果是 S 那么是单独一个,其他的是一个,求从 1 开始的递增的数量是多少. 析:那么S 是单独的,要统计上,既然是从 1 开始递增的,那么再统计 1 的数量即可 ...
- 【hihocoder 1258 Osu! Master】
2015北京区域赛现场赛签到题. 题面:http://media.hihocoder.com/contests/icpcbeijing2015/problems.pdf OJ链接:http://hih ...
- hiho1258 Osu! Master
题目链接:http://hihocoder.com/problemset/problem/1258 题目大意:看能连击的次数 思路:水 看有多少个1和s就好了 #include <stdio.h ...
- dockerfile的编写参数
注意细节 “#”号开头是注释 ,指令不区分大小写,顺序执行 FROM 指定基础镜像:注意必须是文件里第一个非注释行 ENV name 值 设置变量,注意没有=号 变量引用 ${name:-chenxi ...
- UVALive 4670 Dominating Patterns --AC自动机第一题
题意:多个模板串,一个文本串,求出那些模板串在文本串中出现次数最多. 解法:AC自动机入门模板题. 代码: #include <iostream> #include <cstdio& ...
- UVALive 5103 Computer Virus on Planet Pandora Description 一些新兴需求模式的字符串 AC自己主动机
主题链接:option=com_onlinejudge&Itemid=8&page=show_problem&problem=3104">点击打开链接 题意: ...
- UVALive - 3490 Generator (AC自动机+高斯消元dp)
初始有一个空串s,从前n个大写字母中不断随机取出一个字母添加到s的结尾,出现模式串t时停止,求停止时s的长度期望. 这道题解法不唯一,比较无脑的方法是对模式串t建一个单串AC自动机,设u为自动机上的一 ...
- UVALive - 4126 Password Suspects (AC自动机+状压dp)
给你m个字符串,让你构造一个字符串,包含所有的m个子串,问有多少种构造方法.如果答案不超过42,则按字典序输出所有可行解. 由于m很小,所以可以考虑状压. 首先对全部m个子串构造出AC自动机,每个节点 ...
随机推荐
- <hdu - 1232> 畅通工程 并查集问题 (注意中的细节)
本题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1232 结题思路:因为题目是汉语的,那我就不解释题意了,要求的是最少建设的道路,我们可以用并查集来做这 ...
- ViewController
ViewController ViewController 进入VC后先调用loadView,再调用ViewDidLoad ViewDidLoad皆为系统调用 需要先调用[super viewDidL ...
- hibernate、easyui、struts2整合
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 在CentOS上安装第三方软件库EPEL
Extra Packages for Enterprise Linux (EPEL)[企业版 Linux 附加软件包(以下简称 EPEL)]是一个由特别兴趣小组创建.维护并管理的,针对 红帽企业版 L ...
- python 命名规范
参考Google开源项目风格指南:https://zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/cont ...
- @property、@synthesize和dynamic的用法
原文: http://blog.csdn.net/hherima/article/details/8622948 @代表“Objective-C”的标志,证明您正在使用Objective-C语言 O ...
- php 学习之对象
php中怎么实现创建一个对象然后全局都能调用? 在PHP中相当常见的一种情形时,我们只需要创建一个对象一次,然后在我们的整个程序中使用它.一个很好的例子就是smarty变量,一旦被初始化后就可以在任何 ...
- bison实例
逆波兰记号计算器[文件名rpcalc.y]%{ #define YYSTYPE double #include <stdio.h> #include <math.h> #inc ...
- chrome下li标签onclick事件无效
//绑定事件 $(document).ready(function () { $("ul").children().click(function () { clickLi(this ...
- spring的校验框架 @Validated & BindingResult
controller上写法类似这样: @RequestMapping(value = "saleInfoList.json", method = RequestMethod.GET ...