Algo Beat Contest 001 D题求条
  • 板块学术版
  • 楼主a_small_penguin
  • 当前回复0
  • 已保存回复0
  • 发布时间2025/2/3 22:47
  • 上次更新2025/2/4 13:35:54
查看原帖
Algo Beat Contest 001 D题求条
767155
a_small_penguin楼主2025/2/3 22:47

code:

#include<bits/stdc++.h>
using namespace std;

#define mod 1000000007

unordered_map<unsigned long long, unsigned long long> mp;

int n;
unsigned long long a[2009];
unsigned long long b[2009];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    cin >> n;
    for(int i = 1; i <= n; i++) {
    	cin >> a[i];
    }
    for(int i = 1; i <= n; i++) {
    	cin >> b[i];
    	unordered_set<unsigned long long> st;
    	for(int j = 1; j <= n; j++) {
    		st.insert(b[i] * a[j] % mod);
    	}
    	for(auto it:st) {
    		mp[it]++;
    	}
    }
    unsigned long long maxn = 0;
    for(auto it:mp) {
    	maxn = max(maxn, it.second);
    }
    cout << maxn;
    return 0;
}


WA #21-29 #31-40

2025/2/3 22:47
加载中...