Submission #1026712

#TimeUsernameProblemLanguageResultExecution timeMemory
1026712mansurJobs (BOI24_jobs)C++17
0 / 100
6 ms2648 KiB
#include<bits/stdc++.h> using namespace std; #define rall(s) s.rbegin(), s.rend() #define all(s) s.begin(), s.end() #define sz(s) (int)s.size() #define s second #define f first using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; const int N = 1e6; const ll inf = 1e18; void solve() { int n; cin >> n; if (n <= 2) { cout << -1; return; } int x[n + 1], y[n + 1]; set<int> sx, sy; for (int i = 1; i <= n; i++) { cin >> x[i] >> y[i]; sx.insert(x[i]); sy.insert(y[i]); } if (sz(sx) == 2 && sz(sy) == 2 && *sx.begin() == *--sx.end() - 1 && *sy.begin() == *--sy.end() - 1) cout << 1; else cout << -1; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); solve(); }
#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...