HDU 1800 Flying to the Mars
2014-07-24 15:25
260 查看
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1800
moving table那题的同类,找相同即可
moving table那题的同类,找相同即可
#include<stdio.h> #include<stdlib.h> int a[3005]; int cmp( const void *a , const void *b ) { return *(int *)b - *(int *)a ; } int main() { int i,n,count,max; while(scanf("%d",&n)!=EOF) { for(i=0;i<n;i++) scanf("%d",&a[i]); qsort(a,n,sizeof(a[0]),cmp); max = count = 1; for(i=1;i<n;i++) { if(a[i-1] == a[i] ) { count++; if(count > max) max = count; continue; } count = 1; } printf("%d\n",max); } return 0; }
相关文章推荐
- HDU 1800 Flying to the Mars(贪心 MAP 字典树 HASH)
- hdu 1800 Flying to the Mars(HashMap水过,可用字典树)
- hdu 题目1800 Flying to the Mars (Hash字符串 应用)
- HDU 1800 Flying to the Mars
- HDU 1800 Flying to the Mars (贪心)
- Hdu-1800 Flying to the Mars
- hdu 1800 Flying to the Mars map的基本用法
- hdu 1800 Flying to the Mars
- hdu 1800 flying to the Mars(BKDR Hash)
- HDU 1800 Flying to the Mars
- HDU-1800-Flying to the Mars
- HDU-1800 Flying to the Mars
- hdu 1800 Flying to the Mars
- hdu 1800 Flying to the Mars
- HDU 1800 Flying to the Mars
- Flying to the Mars HDU 1800(字典树)
- HDU 1800 Flying to the Mars(trie)
- HDU -1800 Flying to the Mars
- HDU--1800 -- Flying to the Mars
- hdu 1800 Flying to the Mars【水水】