답안 #1101746

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1101746 2024-10-16T18:04:34 Z rayan_bd Jarvis (COCI19_jarvis) C++17
0 / 70
53 ms 12332 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; 


#define getar(ar,n) for(ll i=0;i<n;++i) cin>>ar[i]
#define show(n) cout<<n<<'\n'
#define all(v) v.begin(), v.end()
#define br cout<<"\n"
#define pb push_back
#define nl '\n'
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define ret return
#define ll long long
#define ld long double
#define sza(x) ((int)x.size())

const int mxN = 1e6 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;

unordered_map<ll,vector<ll>> mp;

void solve() {
    ll n;cin>>n;
    vector<ll> a(n),b(n);
	for(ll i=0;i<n;++i){
		cin>>a[i];
		a[i]+=mxN;
	}
	for(ll i=0;i<n;++i){
		cin>>b[i];
		b[i]+=mxN;
	}
	ll idx=0;
    for(auto it:a){
    	mp[it].pb(b[idx++]);
    }
    ll ans=0,mx=0;
    for(auto it:mp){
    	map<ll,ll> freq;
    	for(auto it2:mp[it.first]){
    		if(it2!=it.first) mx=max(mx,++freq[it2]);
    		else ++ans;
    	}
    }
    cout<<mx+ans<<nl;
}

signed main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    solve();
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Incorrect 13 ms 3680 KB Output isn't correct
3 Incorrect 14 ms 3668 KB Output isn't correct
4 Incorrect 12 ms 3668 KB Output isn't correct
5 Incorrect 40 ms 12224 KB Output isn't correct
6 Incorrect 43 ms 12224 KB Output isn't correct
7 Incorrect 40 ms 12224 KB Output isn't correct
8 Incorrect 42 ms 12232 KB Output isn't correct
9 Incorrect 43 ms 12224 KB Output isn't correct
10 Incorrect 53 ms 12332 KB Output isn't correct