【模拟】bzoj2295 【POJ Challenge】我爱你啊
#include<cstdio>
#include<cstring>
using namespace std;
int n;
char s[100001],table[]="luvletter";
int main()
{
scanf("%d",&n); getchar();
for(;n;--n)
{
gets(s);
int m=strlen(s),ans=0,p=0;
for(int i=0;i<m;++i)
if(s[i]==table[p])
{
if(p==8) ++ans;
p=(p+1)%9;
}
printf("%d\n",ans);
}
return 0;
}
【模拟】bzoj2295 【POJ Challenge】我爱你啊的更多相关文章
- BZOJ 2295: [POJ Challenge]我爱你啊
由于是子序列,那么难度就在于读入 #include<cstdio> #include<algorithm> #include<cstring> using name ...
- BZOJ2295: 【POJ Challenge】我爱你啊
2295: [POJ Challenge]我爱你啊 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 126 Solved: 90[Submit][Sta ...
- bzoj2295【POJ Challenge】我爱你啊*
bzoj2295[POJ Challenge]我爱你啊 题意: 求一个字符串中有多少个"luvletter"(不包括引号).字符串长度≤100000. 题解: 连kmp都不用…… ...
- bzoj 2295: 【POJ Challenge】我爱你啊
2295: [POJ Challenge]我爱你啊 Time Limit: 1 Sec Memory Limit: 128 MB Description ftiasch是个十分受女生欢迎的同学,所以 ...
- [bzoj2288]【POJ Challenge】生日礼物_贪心_堆
[POJ Challenge]生日礼物 题目大意:给定一个长度为$n$的序列,允许选择不超过$m$个连续的部分,求元素之和的最大值. 数据范围:$1\le n, m\le 10^5$. 题解: 显然的 ...
- 【链表】BZOJ 2288: 【POJ Challenge】生日礼物
2288: [POJ Challenge]生日礼物 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 382 Solved: 111[Submit][S ...
- BZOJ2288: 【POJ Challenge】生日礼物
2288: [POJ Challenge]生日礼物 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 284 Solved: 82[Submit][St ...
- BZOJ2293: 【POJ Challenge】吉他英雄
2293: [POJ Challenge]吉他英雄 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 80 Solved: 59[Submit][Stat ...
- BZOJ2287: 【POJ Challenge】消失之物
2287: [POJ Challenge]消失之物 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 254 Solved: 140[Submit][S ...
- BZOJ2296: 【POJ Challenge】随机种子
2296: [POJ Challenge]随机种子 Time Limit: 1 Sec Memory Limit: 128 MBSec Special JudgeSubmit: 114 Solv ...
随机推荐
- springboot之模板
转:http://jisonami.iteye.com/blog/2301387,http://412887952-qq-com.iteye.com/blog/2292402 整体步骤:(1) ...
- tomcat内存配置及配置参数详解
1.jvm内存管理机制: 1)堆(Heap)和非堆(Non-heap)内存 按照官方的说法:“Java 虚拟机具有一个堆,堆是运行时数据区域,所有类实例和数组的内存均从此处分配.堆是在 Java 虚拟 ...
- Install the AWS Command Line Interface on Linux
Install the AWS Command Line Interface on Linux You can install the AWS Command Line Interface and i ...
- ES6学习笔记(三)—— Set 和 Map
SetES6提供的数据结构,类似于数组,但是成员的值都是唯一的.(提供了一种数组去重的方法) Set 内部判断两个值是否相同使用的是 'Same-value equality',类似于 ===但是 N ...
- TDS开启log TDS开启SSL
参考: http://www.ibm.com/developerworks/tivoli/library/t-tds-perf/ 1. 编辑ldif文件如下 dn: cn=Audit, cn=Log ...
- 【poj3734】矩阵乘法
题解: 若当前有i个格子.2个是偶数的方案数为a[i]1个是偶数的方案数为b[i]0个是偶数的方案数为c[i] a[i+1]=2*a[i](i+1染成黄或蓝)+b[i](把奇数变为偶数)b[i+1]= ...
- Bzoj3441 乌鸦喝水
Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 258 Solved: 97 Description [题目背景] 一只乌鸦在自娱自乐,它在面 ...
- Android 全面插件化 RePlugin 流程与源码解析
转自 Android 全面插件化 RePlugin 流程与源码解析 RePlugin,360开源的全面插件化框架,按照官网说的,其目的是“尽可能多的让模块变成插件”,并在很稳定的前提下,尽可能像开发普 ...
- Linux : 从私钥中提取公钥
已知一个私钥, 如何从其中提取公钥出来? 提取公钥 ssh-keygen -y -f /path/to/private_key > /path/to/public_key
- bootstrap——集合
1.<nav class="navbar navbar-inverse"> inverse,反色,原导航条为白色,加-inverse后改为黑色 2.data-tog ...