# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
416316 | 2021-06-02T10:16:56 Z | Runtime_error_ | Count Squares (CEOI19_countsquares) | C++14 | 3039 ms | 211288 KB |
#include <bits/stdc++.h> #define ll long long using namespace std; const ll inf = 1509; ll n,m,ans,h[inf],v[inf]; map<ll,ll> LengthV,LengthH; int main(){ scanf("%lld%lld",&n,&m); for(ll i=1;i<=n;i++){ scanf("%lld",h+i); for(ll j=1;j<i;j++) LengthH[ h[i]-h[j] ]++; } for(ll i=1;i<=m;i++){ scanf("%lld",v+i); for(ll j=1;j<i;j++) LengthV[v[i]-v[j]]++; } for(auto o:LengthH) ans += o.second * LengthV[o.first]; printf("%lld\n",ans); } /* 4 1 4 2 5 6 3 6 4 5 1 2 */
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 320 KB | Output is correct |
5 | Correct | 1 ms | 292 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 320 KB | Output is correct |
5 | Correct | 1 ms | 292 KB | Output is correct |
6 | Correct | 361 ms | 33928 KB | Output is correct |
7 | Correct | 300 ms | 33860 KB | Output is correct |
8 | Correct | 334 ms | 33960 KB | Output is correct |
9 | Correct | 307 ms | 33052 KB | Output is correct |
10 | Correct | 12 ms | 948 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 320 KB | Output is correct |
5 | Correct | 1 ms | 292 KB | Output is correct |
6 | Correct | 361 ms | 33928 KB | Output is correct |
7 | Correct | 300 ms | 33860 KB | Output is correct |
8 | Correct | 334 ms | 33960 KB | Output is correct |
9 | Correct | 307 ms | 33052 KB | Output is correct |
10 | Correct | 12 ms | 948 KB | Output is correct |
11 | Correct | 3039 ms | 211284 KB | Output is correct |
12 | Correct | 2825 ms | 211100 KB | Output is correct |
13 | Correct | 2778 ms | 211288 KB | Output is correct |
14 | Correct | 2470 ms | 208644 KB | Output is correct |
15 | Correct | 88 ms | 1860 KB | Output is correct |