USACO2004 US OPEN 翻译

来源:百度知道 编辑:UC知道 时间:2024/05/22 15:12:15
请人翻译以下文字:
The Cow Lineup
Time Limit: 1000MS Memory Limit: 30000K
Total Submissions: 3056 Accepted: 1818

Description

Farmer John's N cows (1 <= N <= 100,000) are lined up in a row.Each cow is labeled with a number in the range 1...K (1 <= K <=10,000) identifying her breed. For example, a line of 14 cows might have these breeds:

1 5 3 2 5 1 3 4 4 2 5 1 2 3

Farmer John's acute mathematical mind notices all sorts of properties of number sequences like that above. For instance, he notices that the sequence 3 4 1 3 is a subsequence (not necessarily contiguous) of the sequence of breed IDs above. FJ is curious what is the length of the shortest possible sequence he can construct out of numbers in the range 1..K that is NOT a subsequence of the breed IDs of his cows. Help him solve this problem.

Input

* Line 1: Two integers, N and K

* Lines 2..N+1: Each line contains a sin

这是程序,不能翻译,就是程序语言

奶牛系列
时间限制: 1000MS内存限制: 30000K
共计提交: 3056接受: 1818年

描述

农民约翰的N奶牛( 1“为N ” = 100000 )正在排队的row.Each牛标记与一些范围1...度( 1“ = K ” = 10000 )查明她的滋生。例如,一排14头牛有可能这些品种:

1 53251 344251 23

农民约翰的急性数学铭记告示各种性能的一些序列这样以上。例如,他通知的顺序34 1 3是一个子(不一定是连续的)的序列品种的ID以上。福建是好奇什么是长度尽可能短的序列,他可以构造出号码的范围1 .. K这不是一个子品种的牛的ID 。帮助他解决这个问题。

输入

*第1行:两个整数, N和K

*线路2 .. ñ一:每行包含一个整数,这是滋生的ID牛。 2号线介绍奶牛1 ;第3行介绍奶牛2 ,等等。

输出

*第1行:长度最短的序列,这不是子的投入

奶牛系列
时间限制: 1000MS内存限制: 30000K
共计提交: 3056接受: 1818年

描述

农民约翰的N奶牛( 1“为N ” = 100000 )正在排队的row.Each牛标记与一些范围1...度( 1“ = K ” = 10000 )查明她的滋生。例如,一排14头牛有可能这些品种:

1 53251 344251 23

农民约翰的急性数学铭记告示各种性能的一些序列这样以上。例如,他通知的顺序34 1 3是一个子(不一定是连续的)的序列品种的ID以上。福建是好奇什么是长度尽可能短的序列,他可以构造出号码的范围1 .. K这不是一个子品种的牛的ID 。帮助他解决这个问题。

输入

*第1行:两个整数, N和K

*线路2 .. ñ一:每行包含一个整数,这是滋生的ID牛。 2号