标签:style blog class code c java
hash做法:
#include<stdio.h> #include<string.h> const int Max = 100010; int home[Max],away[Max],hash[Max]; int main() { int n,sum,total; int i,j; while(scanf("%d",&n)!=EOF) { sum = 0; total = 2*(n-1); for(i=0;i<n;i++) scanf("%d %d",&home[i],&away[i]); memset(hash,0,sizeof(hash)); for(i=0;i<n;i++) hash[home[i]]++;//重复出现的主场number for(i=0;i<n;i++) printf("%d %d\n",n-1+hash[away[i]],n-1-hash[away[i]]); } return 0; }
CF 432B :Football Kit,布布扣,bubuko.com
标签:style blog class code c java
原文地址:http://www.cnblogs.com/XDJjy/p/3732863.html