Submission #445028

#TimeUsernameProblemLanguageResultExecution timeMemory
445028Dipra_IrhamJarvis (COCI19_jarvis)C++17
70 / 70
49 ms3000 KiB
#include "bits/stdc++.h" #define pb(x) push_back(x) #define fil(x, y) memset(x, y, sizeof(x)) #define ll long long #define ff first #define ss second #define printp(x) x.ff << " " << x.ss #define pii pair<int,int> #define pll pair<long long,long long> #define mp(x, y) make_pair(x,y) #define inf 1073741823 #define infll 4611686018427387903 #define M 1000000007 #define db(x) cout << x << " "; #define N 200007 #define sz size #define sm 0.0000007 #define ins insert #define ers erase #define all(k) k.begin(), k.end() #define cnt count #define fastio ios_base::sync_with_stdio(0);cin.tie(0) using namespace std; int main() { fastio; int n; cin >> n; int a[n]; int b[n]; for(int i = 0;i < n;i++) { cin >> a[i]; } for(int i = 0;i < n;i++) { cin >> b[i]; } vector <int> mn; map <int, int> amio; for(int i = 0;i < n;i++) { int x = b[i] - a[i]; if(amio[x] == 0) mn.pb(x); amio[x]++; } int mx = -inf; for(int i = 0;i < mn.sz();i++) { mx = max(mx, amio[mn[i]]); } cout << mx << endl; return 0; }

Compilation message (stderr)

jarvis.cpp: In function 'int main()':
jarvis.cpp:52:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   52 |     for(int i = 0;i < mn.sz();i++)
      |                   ~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...