답안 #1111828

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1111828 2024-11-13T03:00:27 Z ezzzay Count Squares (CEOI19_countsquares) C++14
100 / 100
1861 ms 143128 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back
const int N=3e5+5;
int ans=0;
int x[N],y[N];
map<int,int>px,py;
signed main(){
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>x[i];
    }
    for(int i=1;i<=m;i++){
        cin>>y[i];
    }
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            px[x[j]-x[i]]++;
        }
    }
    int ans=0;
    for(int i=1;i<=m;i++){
        for(int j=i+1;j<=m;j++){
            ans+=px[y[j]-y[i]];
        }
    }
    cout<<ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 2384 KB Output is correct
3 Correct 1 ms 2384 KB Output is correct
4 Correct 2 ms 2384 KB Output is correct
5 Correct 1 ms 2384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 2384 KB Output is correct
3 Correct 1 ms 2384 KB Output is correct
4 Correct 2 ms 2384 KB Output is correct
5 Correct 1 ms 2384 KB Output is correct
6 Correct 145 ms 24972 KB Output is correct
7 Correct 143 ms 24904 KB Output is correct
8 Correct 166 ms 24852 KB Output is correct
9 Correct 142 ms 24184 KB Output is correct
10 Correct 8 ms 2760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 2384 KB Output is correct
3 Correct 1 ms 2384 KB Output is correct
4 Correct 2 ms 2384 KB Output is correct
5 Correct 1 ms 2384 KB Output is correct
6 Correct 145 ms 24972 KB Output is correct
7 Correct 143 ms 24904 KB Output is correct
8 Correct 166 ms 24852 KB Output is correct
9 Correct 142 ms 24184 KB Output is correct
10 Correct 8 ms 2760 KB Output is correct
11 Correct 1706 ms 143128 KB Output is correct
12 Correct 1802 ms 143040 KB Output is correct
13 Correct 1824 ms 142924 KB Output is correct
14 Correct 1861 ms 141068 KB Output is correct
15 Correct 42 ms 3408 KB Output is correct