Submission #1063248

#TimeUsernameProblemLanguageResultExecution timeMemory
1063248antonPortal (BOI24_portal)C++17
0 / 100
883 ms1048576 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define pii pair<int, int> #define p complex<int> const int MAX_N = 3e5+1; int N; int mod(p pos){ return pos.real() * pos.real() + pos.imag()* pos.imag(); } signed main(){ cin>>N; vector<p> portals; for(int i = 0; i<N; i++){ int a, b; cin>>a>>b; portals.push_back({a, b}); } vector<p> merges; for(int i = 0; i<N; i++){ for(int j = 0; j<N; j++){ if(i != j){ merges.push_back(portals[i]-portals[j]); } } } if(merges.size() == 0){ cout<<-1<<endl; return 0; } int res = 1e18; for(auto e: merges){ res = min(res, mod(e)); } cout<<res<<endl; }
#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...