{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e对于一个给定的数组,将数组里的元素重新排列,使得有尽量多的位置上的数大于原来该位置上的数。\u003c/p\u003e \n\u003cp\u003e例如,对于给定的数组 \u003cb\u003e[10, 20, 30, 40]\u003c/b\u003e,我们可以将其重排为 \u003cb\u003e[20, 40, 10, 30]\u003c/b\u003e。此时,第一位与第二位的数都变大了,对应的结果为 2。\n\u003cp\u003e现在对于给定的数组,算出这一结果的最大值。\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e第一行有一个整数 \u003cb\u003en\u003c/b\u003e (\u003cb\u003e1 \u0026leq; n \u0026leq; 10\u003csup\u003e5\u003c/sup\u003e\u003c/b\u003e),表示数组的长度。\u003c/p\u003e \n\u003cp\u003e第二行有 \u003cb\u003en\u003c/b\u003e 个整数 \u003cb\u003ea\u003csub\u003e1\u003c/sub\u003e, a\u003csub\u003e2\u003c/sub\u003e, ..., a\u003csub\u003en\u003c/sub\u003e\u003c/b\u003e (\u003cb\u003e1 \u0026leq; a\u003csub\u003ei\u003c/sub\u003e \u0026leq; 10\u003csup\u003e9\u003c/sup\u003e\u003c/b\u003e),表示数组的每个元素。\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e输出一个整数,表示重排后最多有多少个位置上的数大于该位置上原来的数。\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n 输入\n \u003c/div\u003e \n \u003cpre\u003e7\u003cbr\u003e10 1 1 1 5 5 3\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n 输出\n \u003c/div\u003e \n \u003cpre\u003e4\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n 输入\n \u003c/div\u003e \n \u003cpre\u003e5\u003cbr\u003e1 1 1 1 1\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n 输出\n \u003c/div\u003e \n \u003cpre\u003e0\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003e对于样例 1,重排为 \u003cb\u003e[1, 5, 5, 3, 10, 1, 1]\u003c/b\u003e,对应的答案为 4。\u003c/p\u003e \n\u003cp\u003e对于样例 2,无论如何重排结果都是 0。\u003c/p\u003e"}}]}