http://acm.hdu.edu.cn/showproblem.php?pid=1235
以分数为路径存储,传说中的哈希思想。
水题一道~。
#include <iostream>
using namespace std;
#define N 105
int score[N];
int main(){
#ifndef ONLINE_JUDGE
freopen("1235in.txt","r",stdin);
#endif
int n,i,t;
while (scanf("%d",&n)!=EOF&&n){
memset(score,0,sizeof(score));
for (i=0;i<n;i++){
scanf("%d",&t);
score[t]++;
}
scanf("%d",&t);
printf("%d\n",score[t]);
}
return 0;
}