``````用了map<pair<int, int>, int > p; AC的。

``````

``````unordered_map<LL LL, int> p;

//哈希函数
//如果保证Hash比a, b都大。
//那么不同pair<int, int>映射成的long long一定不同。
//保证没有冲突
LL HX(LL a, LL b)
{
return a*Hash+b;
}

p[HX(a[i], b[i])]++;
``````

``````struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
// http://xorshift.di.unimi.it/splitmix64.c
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}

size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};
``````

``````#include<bits/stdc++.h>
#define LL long long
#define p1 first
#define p2 second
using namespace std;
const LL mod=1e9+1;
//memset(a, 0, sizeof(a));
//stack堆栈 queue队列 priority_queue优先队列
//vector向量 multiset平衡二叉树 deque双端队列
//pair{T1 first;T2 second;} greater<T>
//unordered_map 哈希map

int a[200005];
int b[200005];

struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
// http://xorshift.di.unimi.it/splitmix64.c
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}

size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};

unordered_map<long long, int, custom_hash> p;
//gp_hash_table<long long, int, custom_hash> safe_hash_table;

LL HX(LL a, LL b)
{
return a*mod+b;
}

int main()
{
int n, u=0;
scanf("%d",&n);
for(int i=0; i<n; i++)
{
scanf("%lld",&a[i]);
}
for(int i=0; i<n; i++)
{
scanf("%lld",&b[i]);
}
for(int i=0; i<n; i++)
{
if(a[i]==0&&b[i]==0)
{
u++;
}
else if(a[i]==0)
{

}
else
{
LL g=__gcd(a[i], b[i]);
a[i]/=g, b[i]/=g;
p[HX(a[i], b[i])]++;
}
}
int MAX=0;
for(unordered_map<long long, int, custom_hash>::iterator i=p.begin();i!=p.end();i++)
{
MAX=max(int(i->p2), MAX);
}
cout<<MAX+u<<endl;

return 0;
}
``````