{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e农夫约翰的一些奶牛(1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 80,000)头发乱糟糟!由于每头奶牛都对自己凌乱的发型感到不安,约翰想要计算能看到其他奶牛头顶的奶牛数量。\u003c/p\u003e\u003cp\u003e每头奶牛 \u003ci\u003ei\u003c/i\u003e 都有指定的身高 \u003ci\u003eh\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e(1 ≤ \u003ci\u003eh\u003csub\u003ei \u003c/sub\u003e\u003c/i\u003e ≤ 1,000,000,000),站在一排面向东方的奶牛队列中(在我们的图表中是向右)。因此,奶牛 \u003ci\u003ei\u003c/i\u003e 可以看到她前面的奶牛头顶(即奶牛 \u003ci\u003ei\u003c/i\u003e+1, \u003ci\u003ei\u003c/i\u003e+2,等等),只要这些奶牛严格比奶牛 \u003ci\u003ei\u003c/i\u003e 矮。\u003c/p\u003e\u003cp\u003e考虑以下例子:\u003c/p\u003e\u003cpre\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003d\u003cbr\u003e\u003d\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003d\u003cbr\u003e\u003d\u0026nbsp;\u0026nbsp; -\u0026nbsp;\u0026nbsp; \u003d\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; Cows facing right --\u0026gt;\u003cbr\u003e\u003d\u0026nbsp;\u0026nbsp; \u003d\u0026nbsp;\u0026nbsp; \u003d\u003cbr\u003e\u003d - \u003d \u003d \u003d\u003cbr\u003e\u003d \u003d \u003d \u003d \u003d \u003d\u003cbr\u003e1 2 3 4 5 6 \u003c/pre\u003e\u003cp\u003e奶牛#1可以看到奶牛#2, 3, 4的发型\u003cbr\u003e奶牛#2看不到任何奶牛的发型\u003cbr\u003e奶牛#3可以看到奶牛#4的发型\u003cbr\u003e奶牛#4看不到任何奶牛的发型\u003cbr\u003e奶牛#5可以看到奶牛#6的发型\u003cbr\u003e奶牛#6根本看不到其他奶牛!\u003cbr\u003e\u003c/p\u003e\u003cp\u003e让 \u003ci\u003ec\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e 表示从奶牛 \u003ci\u003ei\u003c/i\u003e 开始可见发型的奶牛数量;请计算 \u003ci\u003ec\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e 到 \u003ci\u003ec\u003csub\u003eN\u003c/sub\u003e\u003c/i\u003e 的总和。对于这个例子,期望的答案是 3 + 0 + 1 + 0 + 1 + 0 \u003d 5。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"第1行:奶牛的数量,\u003ci\u003eN\u003c/i\u003e。\r\u003cbr\u003e第2行至第N+1行:第 \u003ci\u003ei\u003c/i\u003e+1 行包含一个整数,表示奶牛 \u003ci\u003ei\u003c/i\u003e 的身高。"}},{"title":"输出","value":{"format":"HTML","content":"第1行:一个整数,表示 \u003ci\u003ec\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e 到 \u003ci\u003ec\u003csub\u003eN\u003c/sub\u003e\u003c/i\u003e 的总和。"}},{"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\u003e6\r\n10\r\n3\r\n7\r\n4\r\n12\r\n2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}