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>
using namespace std;
#define int long long
#define pii pair<int, int>
#define P complex<int>
int N;
int cross(P a, P b){
return (a * conj(b)).imag();
}
signed main(){
cin>>N;
vector<P> portals(N);
for(int i = 0; i<N; i++){
pii pos;
cin>>pos.first>>pos.second;
portals[i] = {pos.first, pos.second};
}
P origin = portals[0];
for(P& portal: portals){
portal -= origin;
}
if(N<3 || cross(portals[1], portals[2])==0){
cout<<-1<<endl;
}
else{
cout<<cross(portals[1], portals[2])<<endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |