HDU 1800: Flying to the Mars
Flying to the Mars
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission (s): 10817 Accepted Submission (s): 3469
Problem Description
In the year 8888, the Earth is ruled by the PPF Empire. As the pZ hour? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> crop/crop + CgoKIAo8YnI + crop =" brush: java; "> 410203004523434
Sample Output
12
A broom. High can teach low. As his teacher. Of course, students are low. Ask the minimum number of brooms required. The maximum number of IDs at the same level. The maximum number of brooms is required at the same level. Typical applications can be implemented using hash .. But I'm not ..
#include
#include
#include
#include#include
#include
using namespace std;const int maxn = 30000 + 50;int n;int a[maxn];int ans;int main(){ while(scanf("%d", &n) == 1 ) { memset(a, 0, sizeof(a)); int b; ans = -0x3f3f3f3f; int t = 1; int temp = 1; for(int i=1; i<=n; i++)scanf("%d", &a[i]); sort(a+1, a+n+1); if( n==1 ) printf("1\n"); else { for(int i=2; i<=n; i++) { if( a[i] == a[i-1] ){t++;temp = t;} else t = 1; if( temp>ans ){ans = temp;temp = 1;} } printf("%d\n", ans); } } return 0;}