P2947 [USACO09MAR] Look Up S

题目描述

Farmer John's N (1

输入格式

输出格式

说明/提示

FJ has six cows of heights 3, 2, 6, 1, 1, and 2. Cows 1 and 2 both look up to cow 3; cows 4 and 5 both look up to cow 6; and cows 3 and 6 do not look up to any cow. 【输入说明】$6$ 头奶牛的身高分别为 3,2,6,1,1,2。 【输出说明】奶牛 #1,#2 仰望奶牛 #3,奶牛 #4,#5 仰望奶牛 #6,奶牛 #3 和 #6 没有仰望对象。 【数据规模】 对于 $20\%$ 的数据:$1\le N\le10$; 对于 $50\%$ 的数据:$1\le N\le10^3$; 对于 $100\%$ 的数据:$1\le N\le10^5,1\le H_i\le10^6$。