답안 #200003

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
200003 2020-02-04T17:37:03 Z KLPP Jarvis (COCI19_jarvis) C++14
70 / 70
114 ms 4592 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
lld a[1000000];
lld b[1000000];
int main() {
	int n;
	cin>>n;
	rep(i,0,n)cin>>a[i];
	rep(i,0,n)cin>>b[i];
	vector<lld>v;
	rep(i,0,n){
		v.push_back(a[i]-b[i]);
	}
	sort(v.begin(),v.end());
	int ans=0;
	int cnt=0;
	rep(i,0,n){
		cnt++;
		ans=max(ans,cnt);
		if(i<n-1 && v[i]!=v[i+1])cnt=0;
	}
	cout<<ans<<endl;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 56 ms 3608 KB Output is correct
3 Correct 60 ms 3568 KB Output is correct
4 Correct 55 ms 3568 KB Output is correct
5 Correct 108 ms 4464 KB Output is correct
6 Correct 108 ms 4580 KB Output is correct
7 Correct 110 ms 4464 KB Output is correct
8 Correct 108 ms 4528 KB Output is correct
9 Correct 114 ms 4592 KB Output is correct
10 Correct 114 ms 4588 KB Output is correct