Romeo Meets Juliet
来源:互联网 发布:exo金钟大网络春晚生病 编辑:程序博客网 时间:2024/05/22 00:46
Romeo Meets Juliet
Crawling in process...Crawling failedTime Limit:1000MSMemory Limit:65536KB 64bit IO Format:%I64d & %I64u
Description
Farmer John has two feuding herds of cattle, the Moontagues and the Cowpulets. One of the bulls in the Moontague herd, Romeo, has fallen in love with Juliet, a Cowpulet. Romeo would like to meet with Juliet, but he doesn't want the other members of the Cowpulet herd to find out.
Romeo and Juliet want to meet and graze in as large a region as possible along the pasture fence. However, this region should not contain too many Cowpulets, otherwise the chance of the two being caught is too great. Romeo has determined where along the fence each of the N (1 <= N <= 1000) members of the Cowpulet herd grazes. The long straight fence contains P (1 <= P <= 1000) equally-spaced posts numbered 1..P. Each Cowpulet grazes between some pair of adjacent posts. Help Romeo determine the length of the largest contiguous region along the fence containing no more than C (0 <= C <= 1000) members of the Cowpulet herd.
Romeo and Juliet want to meet and graze in as large a region as possible along the pasture fence. However, this region should not contain too many Cowpulets, otherwise the chance of the two being caught is too great. Romeo has determined where along the fence each of the N (1 <= N <= 1000) members of the Cowpulet herd grazes. The long straight fence contains P (1 <= P <= 1000) equally-spaced posts numbered 1..P. Each Cowpulet grazes between some pair of adjacent posts. Help Romeo determine the length of the largest contiguous region along the fence containing no more than C (0 <= C <= 1000) members of the Cowpulet herd.
Input
* Line 1: Three separated integers: N, P, and C
* Lines 2..N+1: Each line contains an integer X, in the range 1..P-1, specifying that a member of the Cowpulet herd grazes between fence posts X and X+1. Multiple Cowpulets can graze between any given pair of fence posts.
* Lines 2..N+1: Each line contains an integer X, in the range 1..P-1, specifying that a member of the Cowpulet herd grazes between fence posts X and X+1. Multiple Cowpulets can graze between any given pair of fence posts.
Output
* Line 1: A single integer specifying the size (the number of gaps between fence posts) of the largest contiguous region containing at most C Cowpulets.
Sample Input
2 6 123
Sample Output
3
- Romeo Meets Juliet
- poj 2189 Romeo Meets Juliet
- POJ 2189 Romeo Meets Juliet G++
- poj 2189 Romeo Meet juliet 枚举
- OpenCL Programming Template -- Juliet
- Romeo和Juventus
- Romeo和Juventus
- Romeo和Juventus
- Romeo和Juventus
- When Mono Meets SIMD
- Java EE meets Web 2.0
- BoF meets HOG 论文笔记
- 黄东旭:When TiDB Meets Kubernetes
- Parajumpers JULIET 6 producing three Zhens
- Parajumpers JULIET 6 is a evilforeboding
- 演讲实录|马晓宇:When TiDB Meets Spark
- Parajumpers JULIET 6 a heart didn't be
- 开源机器学习:R Meets Weka zz
- 【Android应用开发】-(16)如何绕开Google Play地区限制
- 基于Silverlight+RIA WCF+Sql Server2008的企业级架构及应用(19)
- Cow Laundry
- 用Latex表示矩阵
- C指针与二维数组
- Romeo Meets Juliet
- ISBN
- opencv2.4改变图像的大小
- ORM框架EF(一)增删改查
- linux虚拟机下面编译ffmpeg,并调用其main方法
- hdu 2222 Keywords Search(AC自动机)
- cdev结构 and MKDEV
- California Mathmetics-G6-Ch10
- cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies