# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
266912 | wdjpng | Count Squares (CEOI19_countsquares) | C++17 | 1 ms | 256 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i = 0; i < n; i++)
#define int long long
using namespace std;
signed main(){
int n, m;
vector<int>ver(n);
vector<int>hor(n);
rep(i,n){cin>>ver[i];}
rep(i,m){cin>>hor[i];}
map<int, int>vertDif;
map<int, int>horDif;
rep(i, n){
for(int j=i+1; j<n; i++){
vertDif[ver[j]-ver[i]]++;
}
}
rep(i, m){
for(int j=i+1; j<m; i++){
horDif[hor[j]-hor[i]]++;
}
}
int sum=0;
for(auto k : vertDif){
sum+=k.second*horDif[k.first];
}
cout<<sum;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |