Submission #1049430

# Submission time Handle Problem Language Result Execution time Memory
1049430 2024-08-08T18:24:02 Z aymanrs Portal (BOI24_portal) C++17
0 / 100
1 ms 348 KB
#include<bits/stdc++.h>
using namespace std;
void solve(){
    int n;cin >> n;
    if(n<=2) cout << "-1\n";
    int x[n],y[n];
    for(int i = 0;i < n;i++) cin >> x[i] >> y[i];
    int gx = 0, gy = 0;
    for(int i = 1;i < n;i++){
        x[i] -= x[0];
        y[i] -= y[0];
        if(x[i]) gx = __gcd(gx, abs(x[i]));
        if(y[i]) gy = __gcd(gy, abs(y[i]));
    }
    cout << (long long)gy*gx << '\n';
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    solve();
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -