{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\n给定两个整数序列。编写一个程序来确定它们的最大可能长度的公共递增子序列。\n\u003cbr\u003e长度为N的序列S\u003csub\u003e1\u003c/sub\u003e,S\u003csub\u003e2\u003c/sub\u003e,...,S\u003csub\u003eN\u003c/sub\u003e被称为序列A\u003csub\u003e1\u003c/sub\u003e,A\u003csub\u003e2\u003c/sub\u003e,...,A\u003csub\u003eM\u003c/sub\u003e的递增子序列,长度为M,如果存在1 \u003c\u003d i\u003csub\u003e1\u003c/sub\u003e \u003c i\u003csub\u003e2\u003c/sub\u003e \u003c ... \u003c i\u003csub\u003eN\u003c/sub\u003e \u003c\u003d M,使得对于所有1 \u003c\u003d j \u003c\u003d N,S\u003csub\u003ej\u003c/sub\u003e \u003d A\u003csub\u003ei\u003csub\u003ej\u003c/sub\u003e\u003c/sub\u003e,并且对于所有1 \u003c\u003d j \u003c N,S\u003csub\u003ej\u003c/sub\u003e \u003c S\u003csub\u003ej+1\u003c/sub\u003e。\n"}},{"title":"输入","value":{"format":"HTML","content":"每个序列都用M描述 - 它的长度(1 \u003c\u003d M \u003c\u003d 500)和M个整数A\u003csub\u003ei\u003c/sub\u003e(-2\u003csup\u003e31\u003c/sup\u003e \u003c\u003d A\u003csub\u003ei\u003c/sub\u003e \u003c 2\u003csup\u003e31\u003c/sup\u003e) - 序列本身。"}},{"title":"输出","value":{"format":"HTML","content":"在输出文件的第一行打印L - 两个序列的最大公共递增子序列的长度。在第二行打印子序列本身。如果有多个可能的答案,请输出其中任何一个。"}},{"title":"示例","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n1 4 2 5 -12\r\n4\r\n-12 1 2 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n1 4\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}