제출 #1095104

#제출 시각아이디문제언어결과실행 시간메모리
1095104SalihSahinPortal (BOI24_portal)C++14
1 / 100
21 ms4956 KiB
#include <bits/stdc++.h> #define pb push_back #define int long long using namespace std; const int N = 3e5 + 5; const int K = 20; const int mod = 1e9 + 7; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin>>n; vector<array<int, 2> > p(n); vector<int> x(n), y(n); for(int i = 0; i < n; i++){ cin>>p[i][0]>>p[i][1]; x[i] = p[i][0]; y[i] = p[i][1]; } if(n <= 2){ cout<<-1<<endl; return 0; } sort(x.begin(), x.end()); sort(y.begin(), y.end()); int df1 = mod, df2 = mod; for(int i = 0; i < n-1; i++){ df1 = min(df1, x[i+1] - x[i]); df2 = min(df2, y[i+1] - y[i]); } cout<<df1 * df2<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...