# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1034792 | anango | Alternating Current (BOI18_alternating) | C++17 | 3067 ms | 6260 KiB |
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>
#define int long long
using namespace std;
int INF = 1LL<<30;
int n,m;
vector<pair<int,int>> segments;
vector<int> indices,invindices;
bool inside(int a, int b, int c) {
//is it a,b,c in this order?
bool ans = (a<=b && b<=c) || (a<=b && b>c && c<a) || (a>b && b<=c && c<a);
////cout << a <<" " << b <<" " << c <<" " << ans << endl;
return ans;
}
bool between(pair<int,int> s1, pair<int,int> s2) {
//is s2 fully between s1's endpoints
int a=s1.first; int b = s1.second; int c = s2.first; int d = s2.second;
bool ans = inside(a,c,d) && inside(c,d,b) && inside(a,c,b) && inside(a,d,b);
////cout << a <<" " << b <<" " << c <<" " <<d << " " << ans << endl;
return ans;
}
bool works(vector<int> ans) {
//1 implies 0-covered, 2 implies 1-covered
set<int> remset0;
set<int> remset1;
# | 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... |