이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define loop(i, a, b) for(long long i=a;i<b;i++)
#define pool(i, a, b) for(long long i=a-1;i>=b;i--)
#define fore(i, a) for(auto&& i:a)
#define ll long long
using namespace std;
ll a[1600], b[1600];
map<ll, ll> neki;
int main(){
ll h, v;cin >> h >> v;
loop(i, 0, h) cin >> a[i];
loop(i, 0, v) cin >> b[i];
loop(i, 0, h){
loop(j, 0, i){
neki[a[i]-a[j]]++;
}
}
ll ans=0;
loop(i, 0, v){
loop(j, 0, i){
ans+=neki[b[i]-b[j]];
}
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |