Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## RE了几十次，把结构体命名由node，改成edge就过了。哎！好没意思。

Posted by SL_OVER_SKY at 2014-09-15 21:39:30 on Problem 2785
```#include <algorithm>
#include <cstring>
#include <cstdio>
#include <iostream>
using namespace std;
#define MAXN 4100
#define pri 3999971
int a[MAXN],b[MAXN],c[MAXN],d[MAXN];
struct edge
{
int v,cnt,next;
}edge[pri+1];
int hash(int num)
{
return (num+pri)%pri;
}
{
int cur=hash(num);
if(edge[i].v==num) {edge[i].cnt++;return;}
edge[k].v=num;
edge[k].cnt=1;
}
int find_hash(int num)
{
int cur=hash(num);
if(edge[i].v==num) return edge[i].cnt;
return 0;
}
int main()
{
int n;
while(cin>>n)
{
k=0;
int i,j;
long long ans=0;
for(i=0;i<n;i++)
cin>>a[i]>>b[i]>>c[i]>>d[i];
for(i=0;i<n;i++)
for(i=0;i<n;i++)
for(j=0;j<n;j++) ans+=find_hash(-c[i]-d[j]);
cout<<ans<<endl;
}
return 0;
}
```

Followed by: