{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"如果 \u003ci\u003ea\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e \u0026lt; \u003ci\u003ea\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e \u0026lt; ... \u0026lt; \u003ci\u003ea\u003csub\u003eN\u003c/sub\u003e\u003c/i\u003e,则数值序列 \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e 是有序的。给定数值序列 (\u003ci\u003ea\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003ea\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e, ..., \u003ci\u003ea\u003csub\u003eN\u003c/sub\u003e\u003c/i\u003e) 的子序列可以是任何序列 (\u003ci\u003ea\u003csub\u003ei\u003csub\u003e1\u003c/sub\u003e\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003ea\u003csub\u003ei\u003csub\u003e2\u003c/sub\u003e\u003c/sub\u003e\u003c/i\u003e, ..., \u003ci\u003ea\u003csub\u003ei\u003csub\u003eK\u003c/sub\u003e\u003c/sub\u003e\u003c/i\u003e),其中 1 \u0026lt;\u003d \u003ci\u003ei\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e \u0026lt; \u003ci\u003ei\u003csub\u003e2\u003c/sub\u003e\u003c/i\u003e \u0026lt; ... \u0026lt; \u003ci\u003ei\u003csub\u003eK\u003c/sub\u003e\u003c/i\u003e \u0026lt;\u003d \u003ci\u003eN\u003c/i\u003e。例如,序列 (1, 7, 3, 5, 9, 4, 8) 有有序子序列,例如 (1, 7),(3, 4, 8) 等等。所有最长的有序子序列长度为 4,例如 (1, 3, 5, 8)。\u003cbr\u003e\u003cbr\u003e给定数值序列,你的程序需要找到其最长有序子序列的长度。"}},{"title":"输入","value":{"format":"HTML","content":"输入文件的第一行包含序列长度 N。第二行包含序列的元素 - 每个元素是范围在 0 到 10000 之间的 N 个整数,用空格分隔。1 \u0026lt;\u003d N \u0026lt;\u003d 1000"}},{"title":"输出","value":{"format":"HTML","content":"输出文件必须包含一个整数 - 给定序列的最长有序子序列的长度。"}},{"title":"示例","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e7\r\n1 7 3 5 9 4 8\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}