Submission #445043

# Submission time Handle Problem Language Result Execution time Memory
445043 2021-07-16T09:58:23 Z Tahmid690 Jarvis (COCI19_jarvis) C++14
70 / 70
39 ms 2492 KB
// "Say:He is the Most Merciful,We have believed in him and upon him we have relied" [67:29]
 
//#pragma GCC optimize ("Ofast")
//#pragma GCC target ("avx2")
//#pragma GCC optimize("unroll-loops")
 
#include<bits/stdc++.h>
using namespace std;
                                                     
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 */
 
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<ll> vll;
typedef vector<int> vii;
typedef map<int,int> mpi;
typedef map<ll,ll> mpl;
typedef unordered_map<int,int> umpi;
typedef unordered_map<ll,ll> umpl;
 
#define ump unordered_map
#define mod 1000000007
#define inf 1000000000000000006
#define infi 1000000009
#define ff first
#define ss second
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl '\n'
#define pi acos(-1.0)
#define dec(n) fixed << setprecision(n)
#define N 200005
//#define int long long

ll n,a[N],b[N],mx;
mpl mp;
void solve(){
	mp.clear();
	cin >> n;
	mx=0;
	for(int i=0;i<n;i++) cin >> a[i];
	for(int i=0;i<n;i++) cin >> b[i];
	for(int i=0;i<n;i++) mx=max(mx,++mp[a[i]-b[i]]);
	cout << mx << endl;
}

signed main(){
    fastio;
    //srand(chrono::steady_clock::now().time_since_epoch().count());
    int T=1,cs=0;
    //cin >> T;
    while(T--){
        //cout << "Case " << ++cs << ":" << " " ; 
    	solve();
    } 
}

Compilation message

jarvis.cpp: In function 'int main()':
jarvis.cpp:59:13: warning: unused variable 'cs' [-Wunused-variable]
   59 |     int T=1,cs=0;
      |             ^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 19 ms 1788 KB Output is correct
3 Correct 19 ms 1796 KB Output is correct
4 Correct 18 ms 1872 KB Output is correct
5 Correct 26 ms 1840 KB Output is correct
6 Correct 25 ms 1892 KB Output is correct
7 Correct 28 ms 1860 KB Output is correct
8 Correct 29 ms 1860 KB Output is correct
9 Correct 39 ms 2440 KB Output is correct
10 Correct 38 ms 2492 KB Output is correct