QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#841329 | #8708. Portal | zhassyn# | 1 | 8ms | 5164kb | C++20 | 1.4kb | 2025-01-03 16:57:47 | 2025-01-03 16:57:47 |
Judging History
answer
#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
using namespace std;
#define F first
#define S second
typedef long long ll;
#define pii pair <int, int>
#define pll pair <ll, ll>
typedef long double ld;
const ll N = 1e5 + 100, M = 4096 + 10, len = 315, inf = 1e18;
const ll mod = 1e9 + 7;
ll um(ll a, ll b){
return (1LL * a * b) % mod;
}
ll subr(ll a, ll b){
return ((1LL * a - b) % mod + mod) % mod;
}
pll a[N];
ll calc(ll x, ll b, ll c){
return abs(a[x].S - a[b].S) * abs(a[c].F - a[x].F);
}
ll cc(ll x, ll b, ll c){
return abs(a[x].F - a[b].F) * abs(a[c].S - a[x].S);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ll n;
cin >> n;
for(ll i = 0; i < n; i++){
cin >> a[i].F >> a[i].S;
}
if(n <= 2){
cout << -1;
return 0;
}
if(n == 3){
if(a[0].F == a[1].F && a[1].F == a[2].F){
cout << -1;
return 0;
}
if(a[0].S == a[1].S && a[1].S == a[2].S){
cout << -1;
return 0;
}
if(a[0].F == a[1].F){
cout << calc(0, 1, 2);
return 0;
}
if(a[0].F == a[2].F){
cout << calc(0, 2, 1);
return 0;
}
if(a[1].F == a[2].F){
cout << calc(1, 2, 0);
return 0;
}
if(a[0].S == a[1].S){
cout << calc(0, 1, 2);
return 0;
}
if(a[0].S == a[2].S){
cout << cc(0, 2, 1);
return 0;
}
if(a[1].S == a[2].S){
cout << cc(1, 2, 0);
return 0;
}
return -1;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 1
Accepted
Test #1:
score: 1
Accepted
time: 1ms
memory: 3660kb
input:
1 1 -1
output:
-1
result:
ok single line: '-1'
Test #2:
score: 1
Accepted
time: 0ms
memory: 3596kb
input:
2 -455833 -283524 427847 159281
output:
-1
result:
ok single line: '-1'
Test #3:
score: 1
Accepted
time: 0ms
memory: 3676kb
input:
2 52420 -46322 -192914 87067
output:
-1
result:
ok single line: '-1'
Test #4:
score: 1
Accepted
time: 0ms
memory: 3604kb
input:
2 52446 -20773 179773 174566
output:
-1
result:
ok single line: '-1'
Test #5:
score: 1
Accepted
time: 0ms
memory: 3592kb
input:
2 -229012 -260770 -174790 -69382
output:
-1
result:
ok single line: '-1'
Test #6:
score: 1
Accepted
time: 0ms
memory: 3596kb
input:
2 -127294 418312 211124 37002
output:
-1
result:
ok single line: '-1'
Test #7:
score: 1
Accepted
time: 0ms
memory: 3716kb
input:
2 -129173 516840 46821 -187136
output:
-1
result:
ok single line: '-1'
Test #8:
score: 1
Accepted
time: 0ms
memory: 3656kb
input:
2 -90088 -7423 234488 19625
output:
-1
result:
ok single line: '-1'
Test #9:
score: 1
Accepted
time: 0ms
memory: 3604kb
input:
2 -48105 256695 15135 -80585
output:
-1
result:
ok single line: '-1'
Test #10:
score: 1
Accepted
time: 0ms
memory: 3724kb
input:
2 -251318 79061 182792 -129183
output:
-1
result:
ok single line: '-1'
Test #11:
score: 1
Accepted
time: 0ms
memory: 3728kb
input:
2 784850 417677 -217245 -460999
output:
-1
result:
ok single line: '-1'
Test #12:
score: 1
Accepted
time: 0ms
memory: 3656kb
input:
2 31270 410692 713271 917276
output:
-1
result:
ok single line: '-1'
Test #13:
score: 1
Accepted
time: 0ms
memory: 3732kb
input:
1 230862 -785444
output:
-1
result:
ok single line: '-1'
Test #14:
score: 1
Accepted
time: 0ms
memory: 3716kb
input:
2 222814 -279784 -73657 59849
output:
-1
result:
ok single line: '-1'
Test #15:
score: 1
Accepted
time: 0ms
memory: 3660kb
input:
2 72171 -104186 201480 105502
output:
-1
result:
ok single line: '-1'
Test #16:
score: 1
Accepted
time: 0ms
memory: 3708kb
input:
2 -17727 -27151 69235 15029
output:
-1
result:
ok single line: '-1'
Test #17:
score: 1
Accepted
time: 0ms
memory: 3676kb
input:
2 -44049 96618 173806 -21489
output:
-1
result:
ok single line: '-1'
Test #18:
score: 1
Accepted
time: 0ms
memory: 3676kb
input:
2 -81268 -53452 329866 -163275
output:
-1
result:
ok single line: '-1'
Subtask #2:
score: 0
Runtime Error
Dependency #1:
100%
Accepted
Test #19:
score: 10
Accepted
time: 0ms
memory: 3680kb
input:
3 1 1 1 3 3 2
output:
4
result:
ok single line: '4'
Test #20:
score: 0
Runtime Error
input:
3 123741 -122828 207774 110184 -33847 97305
output:
result:
Subtask #3:
score: 0
Wrong Answer
Test #40:
score: 0
Wrong Answer
time: 8ms
memory: 5164kb
input:
99840 -359536 735499 -710626 400619 -468266 -282389 -192706 43659 204034 -543669 -100576 -749013 -118006 -283125 -341276 405771 560934 835595 -923936 506603 239724 956299 -680746 -737237 286204 982795 -847576 -282389 -949666 986475 996684 -429589 672984 -133717 140954 696491 -879116 -442837 985064 7...
output:
result:
wrong answer 1st lines differ - expected: '610880', found: ''
Subtask #4:
score: 0
Wrong Answer
Test #59:
score: 0
Wrong Answer
time: 0ms
memory: 3664kb
input:
5 0 0 1 0 -1 0 0 1 0 -1
output:
result:
wrong answer 1st lines differ - expected: '1', found: ''
Subtask #5:
score: 0
Skipped
Dependency #2:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%